From da7a3c47025604a6e964d96e71c9a1b3798b6bd5 Mon Sep 17 00:00:00 2001 From: Eric Wright Date: Mon, 20 Oct 2014 17:11:40 -0500 Subject: [PATCH 01/99] Added python script to convert m file output into regular text --- convertQuesoMFileToTxt.py | 101 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 convertQuesoMFileToTxt.py diff --git a/convertQuesoMFileToTxt.py b/convertQuesoMFileToTxt.py new file mode 100644 index 000000000..c00e3589a --- /dev/null +++ b/convertQuesoMFileToTxt.py @@ -0,0 +1,101 @@ +#-----------------------------------------------------------------------bl- +#-------------------------------------------------------------------------- +# +# QUESO - a library to support the Quantification of Uncertainty +# for Estimation, Simulation and Optimization +# +# Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the Version 2.1 GNU Lesser General +# Public License as published by the Free Software Foundation. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc. 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301 USA +# +#-----------------------------------------------------------------------el- + +import re +import sys + +def convertOne(mFileName, getChain=True, getLike=True, getTarget=True, chainIdent=r'[cC]hain\w*', logLikeIdent=r'[lL]ogLikelihood\w*', logTargetIdent=r'[lL]ogTarget\w*'): + mFileNameBase = mFileName.rstrip('.m') + dataEncloseTokens = ('[', ']') + + fIn = open(mFileName,'r') + fileBuf = fIn.read() + fIn.close() + + parseMap = {'chain': (getChain, chainIdent), 'logLikelihood': (getLike, logLikeIdent), 'logTarget': (getTarget, logTargetIdent)} + for item in parseMap: + if parseMap[item][0] == False: + continue + + # Find tag for current item via search with regex: identString\s*=\s*(?=\[) + parseTagRegEx = parseMap[item][1] + r'\s*=\s*' + '(?=' + re.escape(dataEncloseTokens[0]) + ')' + match = re.search(parseTagRegEx, fileBuf) + tag = '' + if match: + tag = match.group(0) + re.escape(dataEncloseTokens[0]) + else: + print 'Error: Could not find identifier {0} in {1}. Regex string: {2}'.format(item, mFileName, parseTagRegEx) + return -1 + + # Extract data between '[ ]' for current item via search with regex: (?<=tag)[^\]]+ + parseDataRegEx = '(?<=' + tag + ')[^' + re.escape(dataEncloseTokens[1]) + ']+' + match = re.search(parseDataRegEx, fileBuf) + if match: + outName = mFileNameBase + '_' + item + '.txt' + fOut = open(outName, 'w') + fOut.write(match.group(0)) + fOut.close() + else: + print 'Error: Could not find {0} data in {1}. Regex string: {2}'.format(item, mFileName, parseDataRegEx) + return -1 + + +if __name__ == "__main__": + usage = 'Usage: {0} [-chain ] [-like ] [-target ] [-chainIdent ] [-likeIdent ] [-targetIdent ] '.format(sys.argv[0]) + if len(sys.argv) < 2 or '--help' in sys.argv or '-h' in sys.argv: + print usage + sys.exit(1) + + # parse options first + optMapGets = {'-chain': True, '-like': True, '-target': True} + for opt in optMapGets: + if opt in sys.argv: + ind = sys.argv.index(opt) + if ind+1 >= len(sys.argv) or sys.argv.count(opt) > 1: + print usage + sys.exit(1) + val = sys.argv.pop(ind+1) + if val.lower() == 'yes': + optMapGets[opt] = True + elif val.lower() == 'no': + optMapGets[opt] = False + else: + print 'Unrecognized value for option {0}: {1}'.format(opt, val) + sys.exit(1) + sys.argv.pop(ind) + + optMapIdents = {'-chainIdent': r'[cC]hain\w*', '-likeIdent': r'[lL]ogLikelihood\w*', '-targetIdent': r'[lL]ogTarget\w*'} + for opt in optMapIdents: + if opt in sys.argv: + ind = sys.argv.index(opt) + if ind+1 >= len(sys.argv) or sys.argv.count(opt) > 1: + print usage + sys.exit(1) + optMapIdents[opt] = sys.argv.pop(ind+1) + sys.argv.pop(ind) + + # parse files one-by-one + for mFileName in sys.argv[1:]: + print 'Converting {0}...'.format(mFileName) + convertOne(mFileName, getChain=optMapGets['-chain'], getLike=optMapGets['-like'], getTarget=optMapGets['-target'], chainIdent=optMapIdents['-chainIdent'], logLikeIdent=optMapIdents['-likeIdent'], logTargetIdent=optMapIdents['-targetIdent']) From c720c99d1a6be67f875b82f5f5218e409de99cd9 Mon Sep 17 00:00:00 2001 From: Eric Wright Date: Mon, 20 Oct 2014 17:26:03 -0500 Subject: [PATCH 02/99] Changed function name to be more descriptive --- convertQuesoMFileToTxt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/convertQuesoMFileToTxt.py b/convertQuesoMFileToTxt.py index c00e3589a..4c106bdfd 100644 --- a/convertQuesoMFileToTxt.py +++ b/convertQuesoMFileToTxt.py @@ -25,7 +25,7 @@ import re import sys -def convertOne(mFileName, getChain=True, getLike=True, getTarget=True, chainIdent=r'[cC]hain\w*', logLikeIdent=r'[lL]ogLikelihood\w*', logTargetIdent=r'[lL]ogTarget\w*'): +def convertMFile(mFileName, getChain=True, getLike=True, getTarget=True, chainIdent=r'[cC]hain\w*', logLikeIdent=r'[lL]ogLikelihood\w*', logTargetIdent=r'[lL]ogTarget\w*'): mFileNameBase = mFileName.rstrip('.m') dataEncloseTokens = ('[', ']') @@ -98,4 +98,4 @@ def convertOne(mFileName, getChain=True, getLike=True, getTarget=True, chainIden # parse files one-by-one for mFileName in sys.argv[1:]: print 'Converting {0}...'.format(mFileName) - convertOne(mFileName, getChain=optMapGets['-chain'], getLike=optMapGets['-like'], getTarget=optMapGets['-target'], chainIdent=optMapIdents['-chainIdent'], logLikeIdent=optMapIdents['-likeIdent'], logTargetIdent=optMapIdents['-targetIdent']) + convertMFile(mFileName, getChain=optMapGets['-chain'], getLike=optMapGets['-like'], getTarget=optMapGets['-target'], chainIdent=optMapIdents['-chainIdent'], logLikeIdent=optMapIdents['-likeIdent'], logTargetIdent=optMapIdents['-targetIdent']) From 758a3d769e46e4cffade11e916032ce3318ad9bf Mon Sep 17 00:00:00 2001 From: Eric Wright Date: Tue, 21 Oct 2014 12:22:19 -0500 Subject: [PATCH 03/99] Changed convertMFile function to give more general output and added better documentation --- convertQuesoMFileToTxt.py | 190 +++++++++++++++++++++++--------------- 1 file changed, 118 insertions(+), 72 deletions(-) diff --git a/convertQuesoMFileToTxt.py b/convertQuesoMFileToTxt.py index 4c106bdfd..06a633f8c 100644 --- a/convertQuesoMFileToTxt.py +++ b/convertQuesoMFileToTxt.py @@ -1,101 +1,147 @@ -#-----------------------------------------------------------------------bl- -#-------------------------------------------------------------------------- -# -# QUESO - a library to support the Quantification of Uncertainty -# for Estimation, Simulation and Optimization -# -# Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the Version 2.1 GNU Lesser General -# Public License as published by the Free Software Foundation. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc. 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301 USA -# -#-----------------------------------------------------------------------el- +""" + -----------------------------------------------------------------------bl- + -------------------------------------------------------------------------- + + QUESO - a library to support the Quantification of Uncertainty + for Estimation, Simulation and Optimization + + Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the Version 2.1 GNU Lesser General + Public License as published by the Free Software Foundation. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc. 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA + +-----------------------------------------------------------------------el- + + This module contains a utility funtion, convertMFile, for converting m-files + generated by QUESO into regular text. See the convertMFile help string for more + specific information on usage and output. Conversion can also be accomplished + by invoking convertQuesoMFileToTxt.py on the command line. In this case, + the script will parse a list of input m-files and create text file output + for each m-file. The script separates the chain data, likelihood data, and + target data into separate output files. For more information on the command + version, run: python convertQuesoMFileToTxt.py --help + +""" import re import sys -def convertMFile(mFileName, getChain=True, getLike=True, getTarget=True, chainIdent=r'[cC]hain\w*', logLikeIdent=r'[lL]ogLikelihood\w*', logTargetIdent=r'[lL]ogTarget\w*'): - mFileNameBase = mFileName.rstrip('.m') +def convertMFile(mFileName, getChain=True, getLike=True, + getTarget=True, chainIdent='[cC]hain', + likeIdent='[lL]ikelihood', targetIdent='[tT]arget'): + """ + + This function parses chain, likelihood, and target data from a single m-file. + mFileName specifies the name of m-file to parse. The get{Chain,Like,Target} + optional inputs take boolean values indicating if the function should parse + that particular item from the file. The {chain,like,target}Ident optional + inputs allow the user to specify a regular expression that identifies that + particular item in the m-file. This function returns a dictionary + containing keys, 'chain', 'logLikelihood', and 'logTarget'. The value + associated with a particular key is the data for that item in character + string format. If the data for an item cannot be found in the file, the + key for that item will not be present in the dictionary. + + """ + + # tokens delimiting the data dataEncloseTokens = ('[', ']') + # Read file into string buffer fIn = open(mFileName,'r') fileBuf = fIn.read() fIn.close() - parseMap = {'chain': (getChain, chainIdent), 'logLikelihood': (getLike, logLikeIdent), 'logTarget': (getTarget, logTargetIdent)} + outputMap = dict() + parseMap = {'chain': (getChain, chainIdent), 'logLikelihood': (getLike, likeIdent), + 'logTarget': (getTarget, targetIdent)} + + # iterate over wanted items and parse them from the buffer for item in parseMap: if parseMap[item][0] == False: continue - # Find tag for current item via search with regex: identString\s*=\s*(?=\[) - parseTagRegEx = parseMap[item][1] + r'\s*=\s*' + '(?=' + re.escape(dataEncloseTokens[0]) + ')' + # Find tag for current item via search with regex: identString\w*\s*=\s*(?=\[) + parseTagRegEx = parseMap[item][1] + r'\w*\s*=\s*' + '(?=' + re.escape(dataEncloseTokens[0]) + ')' match = re.search(parseTagRegEx, fileBuf) tag = '' if match: tag = match.group(0) + re.escape(dataEncloseTokens[0]) else: print 'Error: Could not find identifier {0} in {1}. Regex string: {2}'.format(item, mFileName, parseTagRegEx) - return -1 + return outputMap - # Extract data between '[ ]' for current item via search with regex: (?<=tag)[^\]]+ + # Extract current item data between [ ] via search with regex: (?<=tag)[^\]]+ parseDataRegEx = '(?<=' + tag + ')[^' + re.escape(dataEncloseTokens[1]) + ']+' match = re.search(parseDataRegEx, fileBuf) if match: - outName = mFileNameBase + '_' + item + '.txt' - fOut = open(outName, 'w') - fOut.write(match.group(0)) - fOut.close() + outputMap[item] = match.group(0) else: print 'Error: Could not find {0} data in {1}. Regex string: {2}'.format(item, mFileName, parseDataRegEx) - return -1 + return outputMap + + return outputMap if __name__ == "__main__": - usage = 'Usage: {0} [-chain ] [-like ] [-target ] [-chainIdent ] [-likeIdent ] [-targetIdent ] '.format(sys.argv[0]) - if len(sys.argv) < 2 or '--help' in sys.argv or '-h' in sys.argv: - print usage - sys.exit(1) - - # parse options first - optMapGets = {'-chain': True, '-like': True, '-target': True} - for opt in optMapGets: - if opt in sys.argv: - ind = sys.argv.index(opt) - if ind+1 >= len(sys.argv) or sys.argv.count(opt) > 1: - print usage - sys.exit(1) - val = sys.argv.pop(ind+1) - if val.lower() == 'yes': - optMapGets[opt] = True - elif val.lower() == 'no': - optMapGets[opt] = False - else: - print 'Unrecognized value for option {0}: {1}'.format(opt, val) - sys.exit(1) - sys.argv.pop(ind) - - optMapIdents = {'-chainIdent': r'[cC]hain\w*', '-likeIdent': r'[lL]ogLikelihood\w*', '-targetIdent': r'[lL]ogTarget\w*'} - for opt in optMapIdents: - if opt in sys.argv: - ind = sys.argv.index(opt) - if ind+1 >= len(sys.argv) or sys.argv.count(opt) > 1: - print usage - sys.exit(1) - optMapIdents[opt] = sys.argv.pop(ind+1) - sys.argv.pop(ind) - - # parse files one-by-one - for mFileName in sys.argv[1:]: - print 'Converting {0}...'.format(mFileName) - convertMFile(mFileName, getChain=optMapGets['-chain'], getLike=optMapGets['-like'], getTarget=optMapGets['-target'], chainIdent=optMapIdents['-chainIdent'], logLikeIdent=optMapIdents['-likeIdent'], logTargetIdent=optMapIdents['-targetIdent']) + import argparse + + parser = argparse.ArgumentParser(description='Convert a list of m-files generated by QUESO into text files.') + parser.add_argument('-c', '--chain', type=str, choices=['yes','no'], default='yes', + help='Parse chain data from m-file (default: yes)') + parser.add_argument('-l', '--likelihood', type=str, choices=['yes','no'], default='yes', + help='Parse likelihood data from m-file (default: yes)') + parser.add_argument('-t', '--target', type=str, choices=['yes','no'], default='yes', + help='Parse target data from m-file (default: yes)') + + parser.add_argument('-ci', '--chain_identifier', type=str, default='[cC]hain', + help='RegEx string identifying chain entry in the m-file (default: [cC]hain)') + parser.add_argument('-li', '--likelihood_identifier', type=str, default='[lL]ikelihood', + help='RegEx string identifying likelihood entry in the m-file (default: [lL]ikelihood)') + parser.add_argument('-ti', '--target_identifier', type=str, default='[tT]arget', + help='RegEx string identifying target entry in the m-file (default: [tT]arget)') + + parser.add_argument('mFileList', nargs='+', help='List of m-files to convert') + + args = parser.parse_args() + + if args.chain == 'yes': + getChainOpt = True + else: + getChainOpt = False + + if args.likelihood == 'yes': + getLikeOpt = True + else: + getLikeOpt = False + + if args.target == 'yes': + getTargetOpt = True + else: + getTargetOpt = False + + # process files one-by-one + for mFileName in args.mFileList: + outputMap = convertMFile(mFileName, getChain=getChainOpt, getLike=getLikeOpt, getTarget=getTargetOpt, \ + chainIdent=args.chain_identifier, likeIdent=args.likelihood_identifier, \ + targetIdent=args.target_identifier) + + # Write the data out to text files + mFileNameBase = mFileName.rstrip('.m') + for item in outputMap: + outFileName = mFileNameBase + '_' + item + '.txt' + fOut = open(outFileName, 'w') + fOut.write(outputMap[item]) + fOut.close() + print 'Created file {0}...'.format(outFileName) From 5fab9e88127987629f1872e33d56fc2bc31a2b5f Mon Sep 17 00:00:00 2001 From: "Roy H. Stogner" Date: Thu, 13 Nov 2014 09:52:26 -0600 Subject: [PATCH 04/99] Adding documentation of mixed-effects model --- manual/mixed_effects/Makefile | 113 ++++++++++++++++++++++ manual/mixed_effects/paper.tex | 169 +++++++++++++++++++++++++++++++++ 2 files changed, 282 insertions(+) create mode 100644 manual/mixed_effects/Makefile create mode 100644 manual/mixed_effects/paper.tex diff --git a/manual/mixed_effects/Makefile b/manual/mixed_effects/Makefile new file mode 100644 index 000000000..654993707 --- /dev/null +++ b/manual/mixed_effects/Makefile @@ -0,0 +1,113 @@ +vectorsources := $(shell find rawfigs/ ../common/rawfigs/ -name '*.dia' -o -name '*.eps' -o -name '*.m' -o -name '*.ps' -o -name '*.pdf' -o -name '*.svg' 2>/dev/null) +rastersources := $(shell find rawfigs/ ../common/rawfigs/ -name '*.jpg' -o -name '*.gif' 2>/dev/null) +readysources := $(shell find rawfigs/ ../common/rawfigs/ -name '*.png' -o -name '*.pdf' 2>/dev/null) +texsource := $(wildcard talk.tex paper.tex poster.tex proposal.tex users.tex) + +vectorfigs := $(shell echo ' ' $(vectorsources) ' ' | sed -e 's> \(../common/\)*raw> >g' -e 's/\.[^. ]* /.pdf /g') +rasterfigs := $(shell echo ' ' $(rastersources) ' ' | sed -e 's> \(../common/\)*raw> >g' -e 's/\.[^. ]* /.png /g') +readyfigs := $(shell echo ' ' $(readysources) ' ' | sed -e 's> \(../common/\)*raw> >g') +figures := $(vectorfigs) $(rasterfigs) $(readyfigs) +texroot := $(patsubst %.tex, %, $(texsource)) +texfinal := mixed_effects.pdf +#texfinal := $(texroot).pdf +##dirname := $(shell pwd) +##texfinal := $(shell basename $(dirname)).pdf + +bibfiles := $(wildcard *.bib) +styfiles := $(wildcard *.sty ../common/*.sty) +clsfiles := $(wildcard *.cls ../common/*.cls) + + +PDFLATEX = TEXINPUTS=../common:$$TEXINPUTS pdflatex -halt-on-error +LATEX = TEXINPUTS=../common:$$TEXINPUTS latex -halt-on-error + +.PHONY: all figures clean cleanlatex cleanfigs + +#cheese: tab_mac_cheese + +all: $(texfinal) + +figures: $(figures) + +$(texfinal): *.tex $(bibfiles) $(figures) $(clsfiles) + if ls *.bib 2>&1; then $(PDFLATEX) $(texroot) && bibtex $(texroot); fi + $(PDFLATEX) $(texroot) && $(PDFLATEX) $(texroot) && $(PDFLATEX) $(texroot) + cp $(texroot).pdf "$(texfinal)" + rm -f $(texroot).pdf + +clean: cleanlatex cleanfigs + +cleanlatex: + rm -f $(patsubst %.tex, %.tex.bak, %.aux, $(wildcard *.tex)) + rm -f $(texroot).bbl $(texroot).blg $(texroot).log $(texroot).dvi $(texroot).nav $(texroot).out $(texroot).pdf $(texroot).snm $(texroot).toc $(texroot).vrb *.tex~ *.tex.backup *.aux + rm -f QUESO_users_manual.pdf McCheese.pdf McCheese.log McCheese.dvi McCheese.out McCheese.ps + +cleanfigs: + rm -rf figs/ + +figs/%.pdf: rawfigs/%.dia + @mkdir -p $(dir $@) + dia -t eps-builtin -e $?_roytemp.eps $? && epstopdf $?_roytemp.eps -o=$@ + @rm -f $?_roytemp.eps + +figs/%.pdf: rawfigs/%.eps + @mkdir -p $(dir $@) + epstopdf $? -o=$@ + +figs/%.pdf: rawfigs/%.m + @mkdir -p $(dir $@) + @cd $(dir $?) && octave $(notdir $?) + @epstopdf $?.eps -o=$@ && rm -f $?.eps + +figs/%.pdf: rawfigs/%.pdf + @mkdir -p $(dir $@) + @reldir=`echo $(dir $@) | sed -e 's>[^/]*/*>../>g'`; ln -sf $${reldir}$? $@ + +figs/%.pdf: rawfigs/%.ps + @mkdir -p $(dir $@) + ps2pdf $? $@ + +#figs/%.pdf: rawfigs/%.png +# convert $? $@ + +figs/%.pdf: rawfigs/%.svg + @mkdir -p $(dir $@) + inkscape $? -z --export-pdf=$@ + +figs/%.png: rawfigs/%.jpg + @mkdir -p $(dir $@) + convert $? $@ + +figs/%.png: ../common/rawfigs/%.jpg + @mkdir -p $(dir $@) + convert $? $@ + +figs/%.png: rawfigs/%.png + @mkdir -p $(dir $@) + @reldir=`echo $(dir $@) | sed -e 's>[^/]*/*>../>g'`; ln -sf $${reldir}$? $@ + +figs/%.png: ../common/rawfigs/%.png + @mkdir -p $(dir $@) + @reldir=`echo $(dir $@) | sed -e 's>[^/]*/*>../>g'`; ln -sf $${reldir}$? $@ + +figs/%.pdf: ../common/rawfigs/%.pdf + @mkdir -p $(dir $@) + @reldir=`echo $(dir $@) | sed -e 's>[^/]*/*>../>g'`; ln -sf $${reldir}$? $@ + +figs/%.pdf: ../common/rawfigs/%.eps + @mkdir -p $(dir $@) + epstopdf $? -o=$@ + +figs/%.pdf: ../common/rawfigs/%.ps + @mkdir -p $(dir $@) + ps2pdf $? $@ + +figs/%.pdf: ../common/rawfigs/%.svg + @mkdir -p $(dir $@) + inkscape $? -z --export-pdf=$@ + +#tab_mac_cheese: +# latex McCheese +# latex McCheese +# dvips -t letter McCheese.dvi -o McCheese.ps +# ps2pdf McCheese.ps McCheese.pdf diff --git a/manual/mixed_effects/paper.tex b/manual/mixed_effects/paper.tex new file mode 100644 index 000000000..5f26ba2ba --- /dev/null +++ b/manual/mixed_effects/paper.tex @@ -0,0 +1,169 @@ +\documentclass[11pt, oneside]{article} % use "amsart" instead of "article" for AMSLaTeX format +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{letterpaper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{graphicx} % Use pdf, png, jpg, or epsĀ§ with pdflatex; use eps in DVI mode + % TeX will automatically convert eps --> pdf in pdflatex +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage{mathtools} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + +\begin{center} +{\bf {\LARGE Bayesian Mixed-Effects Modeling}} +\end{center} + +\section{Introduction} + +\noindent +We consider a scenario in which a total of $n_\theta$ model parameters $\mathbf{\theta} = \left(\theta_1, \theta_2, \ldots, \theta_{n_\theta-1}, \theta_{n_\theta} \right)$ are simultaneously calibrated to $M$ experimental datasets $\{ \mathbf{y}_1, \mathbf{y}_2, \ldots, \mathbf{y}_{M-1}, \mathbf{y}_M \}$. The $n_{\theta,i}$-element vector $\mathbf{\theta}_{[i]}$ identifies the subset of parameters in $\theta$ that pertain to the model $\eta_i (\cdot)$ being fitted to dataset $\mathbf{y}_i$, $i = 1, \ldots, M$. The experimental data may in addition be indexed by $n_x$ design variables $\mathbf{x} = \left( x_1, x_2, \ldots, x_{n_x-1}, x_{n_x} \right)$. The subset of design variables pertaining to the $j$-th experimental scenario will be denoted $\mathbf{x}_{[j]}$, $j = 1, \ldots, M$. We assume $\mathbf{y}_j$ consists of $n_j$ observations, the $k$-th of which is associated with design vector $\mathbf{x}_{[j],k}$, $k = 1, \ldots, n_j$. The model calculation pertaining to $y_{jk}$ is therefore $\eta_j \left(\mathbf{x}_{[j],k}, \mathbf{\theta}_{[j]} \right)$. + +\vspace{5mm} + +\noindent +In the code, the structure defined in the previous paragraph is represented by the {\tt clist} matrix. {\tt clist} is a $n_\theta \times M$ matrix, with rows associated with parameters $\{ \theta_1, \ldots, \theta_{n_\theta} \}$ and columns with experimental scenarios $\{ 1, \ldots, M \}$. The column entries in {\tt clist} for scenario $j$ are zero for all rows corresponding to parameters $\theta$ \emph{not} appearing in model $\eta_j (\cdot)$. Parameters appearing in model $\eta_j (\cdot)$ are numbered from 1 to $n_{\theta,j}$ in the $j$-th column of {\tt clist}, in the order they appear in the vector $\mathbf{\theta}$. + +\vspace{5mm} + +\noindent +The adaptive MCMC algorithm implemented for posterior sampling involves generating a multivariate proposal, i.e. in each iteration a single candidate vector that includes every random model parameter is generated. To avoid rejecting candidates based solely on a proposed parameter value falling outside its finite or half-infinite support, we work with a one-to-one transformation of the model parameters $\mathbf{\tau} = f(\mathbf{\theta}) = \left( f_1 \left( \theta_1 \right), \ldots, f_{n_\theta} \left( \theta_{n_\theta} \right) \right)$ that removes interval or half-interval constraints: +\[ +\tau_i = \left\{ \begin{array}{l} +\log \left( \theta_i - \ell_i \right) - \log \left( u_i - \theta_i \right) \,,\,\theta_i \in (\ell_i, u_i) \\ +\log \left( \theta_i - \ell_i \right) \,,\,\theta_i \in (\ell_i, \infty) \\ +\log \left( u_i - \theta_i \right) \,,\,\theta_i \in (-\infty, u_i) \\ +\theta_i \,,\, \theta_i \in (-\infty, \infty) +\end{array} \right. \,. +\] +The inverse transformation $\mathbf{\theta} = f^{-1}(\mathbf{\tau}) = \left( f_1^{-1} \left( \tau_1 \right), \ldots, f_{n_\theta}^{-1} \left( \tau_{n_\theta} \right) \right)$ is given by +\[ +\theta_i = \left\{ \begin{array}{l} +\left( \ell_i + u_i \exp (\tau_i) \right)/\left(1+\exp(\tau_i) \right)\,,\,\theta_i \in (\ell_i, u_i) \\ +\ell_i + \exp(\tau_i) \,,\,\theta_i \in (\ell_i, \infty) \\ +u_i - \exp(\tau_i) \,,\,\theta_i \in (-\infty, u_i) \\ +\tau_i \,,\, \theta_i \in (-\infty, \infty) +\end{array} \right. \,. +\] +The Jacobian matrix of the inverse transformation $f^{-1} (\mathbf{\tau})$, needed later for computation of the log posterior distribution, is thus diagonal with the following elements: +\[ +\frac{\partial f_i^{-1} (\tau_i)}{\partial \tau_i} = \left\{ \begin{array}{l} +\left( u_i - \ell_i \right) \exp(\tau_i) /\left(1+\exp(\tau_i) \right)^2 = \left( \theta_i - \ell_i \right) \left( u_i - \theta_i \right) / \left( u_i - \ell_i \right) \,,\,\theta_i \in (\ell_i, u_i) \\ +\exp(\tau_i) = \theta_i - \ell_i \,,\,\theta_i \in (\ell_i, \infty) \\ +- \exp(\tau_i) = \theta_i - u_i \,,\,\theta_i \in (-\infty, u_i) \\ +1 \,,\, \theta_i \in (-\infty, \infty) +\end{array} \right. \,. +\] + +\vspace{5mm} + +\noindent +Experimental scenario-specific additive perturbations to a subset of the $n_\theta$ fixed effect parameters $\mathbf{\tau}=f(\mathbf{\theta})$ are allowed. In the code, the indices of these parameters are denoted by the vector {\tt hlist}. These perturbations are referred to as random effects, and being specific to the fit of individual experimental datasets, can therefore be associated only with rows of {\tt clist} having more than one non-zero entry. In other words, perturbing a fixed effect $\theta_k$ that is being fit to only a single experimental dataset is redundant. On the other hand, not every fixed effect in common to fitting at least two experimental datasets need be associated with a random effect. We let $n_h$ denote the number of random effects contained in {\tt hlist}, and $\mathbf{\delta}_{[\mbox{{\scriptsize {\tt hlist}}}]}$ a $n_h$-element vector of random effects corresponding to each element of {\tt hlist}. For the $i$-th experimental scenario, only a subset of the perturbations identified by {\tt hlist} may be associated with a subset of the fixed effects $\mathbf{\theta}_{[i]}$, denoted $[h_i] = [i]~\cap$ {\tt hlist}. The associated subset of random effect parameters will thus be denoted $\mathbf{\delta}_{[h_i]}^i$. We let $\mathcal{M}$ denote the set of experimental scenarios for which $[h_i] \ne \varnothing$. + +\vspace{5mm} + +\noindent +To complete the background description, we let $\mathbf{\vartheta}_i$ denote the parameter vector evaluated by the model $\eta_i (\cdot)$ of the $i$-th experimental scenario: If $j \in \{ 1, \ldots, n_{\theta,i} \}$ and $k$ is the $j$-th index element of $[i]$, set +\[ +\vartheta_{i,j} = \left\{ \begin{array}{l} +f_k^{-1}(f_k(\theta_k) + \delta_k^i) \,, \mbox{ for } k \in [h_i] \mbox{ and } i \in \mathcal{M} \,, \\[1ex] +\theta_k \,, \mbox{ otherwise} +\end{array} \right. \,. +\] + +\section{Log-Likelihood Function} + +\noindent +Given $\mathbf{\theta}$ and $\mathbf{\delta}_{[h_i]}^i$ for $i \in \mathcal{M}$, the statistical model for the experimental data is given by +\[ +y_{i,j} = \eta_i \left(\mathbf{x}_{[i],j}, \mathbf{\vartheta}_i \right) + \epsilon_{i,j} \,, j = 1, \ldots, n_i \,,\, i = 1, \ldots, M \,, +\] +where the $n_i$-element experimental error vector $\mathbf{\varepsilon}_i = (\epsilon_{i,1}, \ldots, \epsilon_{i,n_i})^T$ given precision parameter $\lambda_i$ is assumed to be mean-zero Gaussian, +\[ +\mathbf{\varepsilon}_i \sim \mathcal{N} \left( \mathbf{0}_{n_i} \,, \lambda_i^{-1} \mathbf{\Sigma}_i \right) \,. +\] +Here $\mathbf{0}_{n_i}$ denotes the $n_i$-element vector of zeros and the fixed $n_i \times n_i$ matrix $\mathbf{\Sigma}_i$ is symmetric and positive definite. Letting $\mathbf{X}_{[i]} = \left( \mathbf{x}_{[i],1} \, \cdots \, \mathbf{x}_{[i],n_i} \right)^T$ denote the matrix having the input conditions for the $i$-th experimental scenario as rows, and collecting the model evaluations corresponding to each input condition in the $n_i$-element vector $\mathbf{\eta}^i \left( \mathbf{X}_{[i]}, \mathbf{\vartheta}_i \right) = \left(\eta_i \left( \mathbf{x}_{[i],1}, \mathbf{\vartheta}_i \right), \ldots, \eta_i \left( \mathbf{x}_{[i], n_i}, \mathbf{\vartheta}_i \right) \right)^T$, this model is written in vector form as +\[ +\mathbf{y}_i = \mathbf{\eta}^i \left( \mathbf{X}_{[i]}, \mathbf{\vartheta}_i \right) + \mathbf{\varepsilon}_i \,,~\mathbf{\varepsilon}_i \sim \mathcal{N} \left( \mathbf{0}_{n_i} \,, \lambda_i^{-1} \mathbf{\Sigma}_i \right) \,,~ i = 1, \ldots, M \,. +\] +The log-likelihood function is therefore given by +\begin{align*} +\MoveEqLeft[10] \ell \left( \, \mathbf{\theta}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \lambda_1, \ldots, \lambda_M \, | \, \mathbf{y}_1, \ldots, \mathbf{y}_M \, \right) \\ +=& -\frac{1}{2} \left( \log(2 \pi) \sum_{i=1}^M n_i + \sum_{i=1}^M \log \left( \left| \mathbf{\Sigma}_i \right| \right) - \sum_{i=1}^M n_i \log \left( \lambda_i \right) + \right. \\ +&\left. \sum_{i=1}^M \lambda_i \left( \mathbf{y}_i - \mathbf{\eta}^i \left( \mathbf{X}_{[i]}, \mathbf{\vartheta}_i \right) \right)^T \mathbf{\Sigma}_i^{-1} \left( \mathbf{y}_i - \mathbf{\eta}^i \left( \mathbf{X}_{[i]}, \mathbf{\vartheta}_i \right) \right) \right) \,. +\end{align*} +Neglecting constant terms, +\begin{align*} +\MoveEqLeft[5] \ell \left( \, \mathbf{\theta}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \lambda_1, \ldots, \lambda_M \, | \, \mathbf{y}_1, \ldots, \mathbf{y}_M \, \right) \\ +& = \frac{1}{2} \left( \sum_{i=1}^M n_i \log \left( \lambda_i \right) - \sum_{i=1}^M \lambda_i \left( \mathbf{y}_i - \mathbf{\eta}^i \left( \mathbf{X}_{[i]}, \mathbf{\vartheta}_i \right) \right)^T \mathbf{\Sigma}_i^{-1} \left( \mathbf{y}_i - \mathbf{\eta}^i \left( \mathbf{X}_{[i]}, \mathbf{\vartheta}_i \right) \right) \right) \,. +\end{align*} +For the purpose of calculation, we work with $\omega_i = \log(\lambda_i)$, noting that $\lambda_i = \exp(\omega_i)$ and $\partial \lambda_i /\partial \omega_i = \exp(\omega_i) = \lambda_i$. + +\section{Log-Prior Function} + +\noindent +Given the ($n_h (n_h+1)/2$)-element vector $\mathbf{\phi}$, the distribution of the $n_h$-element random effect vector $\delta_{[\mbox{{\scriptsize {\tt hlist}}}]}$ is assumed to be mean-zero Gaussian having $n_h \times n_h$ precision matrix $\mathbf{P} (\mathbf{\phi})$. The parameters $\mathbf{\phi}$ characterize the space of symmetric positive definite matrices in the following way. Given $\mathbf{\phi}$, define the $n_h \times n_h$ symmetric matrix $\mathbf{\Phi}$ having elements $\mathbf{\Phi}_{ij} = \phi_{j+(i-1)(2n_h-i)/2}$ for $j = i, i+1, \ldots, n_h \,,\, i = 1, \ldots, n_h$, and $\mathbf{\Phi}_{ij} = \mathbf{\Phi}_{ji}$ for $i = j+1, \ldots, n_h \,,\, j = 1, \ldots, n_h-1$. The spectral decomposition of $\mathbf{\Phi}$ is given uniquely by $\mathbf{\Phi} = \mathbf{U}_\phi \mathbf{D}_\phi \mathbf{U}_\phi^T$, where $\mathbf{D}_\phi$ is a diagonal matrix having elements $d_{\phi,i}$, $i = 1, \ldots, n_h$. We take $\mathbf{P}(\mathbf{\phi}) = \mathbf{U}_\phi \exp \left( \mathbf{D}_\phi \right) \mathbf{U}_{\phi}^T$, where $\exp \left( \mathbf{D}_\phi \right) = \mbox{ diag} \left( \exp \left( d_{\phi,i} \right) \,,\, i=1,\ldots, n_h \right)$. In this way, $\mathbf{\phi} \leftrightarrow \mathbf{P}(\mathbf{\phi})$ describes a one-to-one relationship between the ($n_h (n_h+1)/2$)-dimensional space of reals and the $n_h \times n_h$ space of real symmetric, positive definite matrices. + +\vspace{5mm} + +\noindent +The random effect vector $\mathbf{\delta}_{[h_i]}^i$ for $i \in \mathcal{M}$ is a subset of $\delta_{[\mbox{{\scriptsize {\tt hlist}}}]}$. Let $\mathbf{\Pi}$ be the permutation matrix such that +\[ +\begin{pmatrix} +\delta_{\mbox{{\scriptsize {\tt hlist}}} \setminus [h_i]}^i \\ +\delta_{[h_i]}^i +\end{pmatrix} = \mathbf{\Pi} \, \delta_{\mbox{{\scriptsize {\tt hlist}}}} \,. +\] +The precision matrix of this rearrangement of $\delta_{[\mbox{{\scriptsize {\tt hlist}}}]}$ is given by +\[ +\mathbf{\Pi} \, \mathbf{P}(\mathbf{\phi}) \, \mathbf{\Pi}^T = \begin{pmatrix} +\mathbf{P}_{\pi,11} (\mathbf{\phi})& \mathbf{P}_{\pi,21}^T (\mathbf{\phi}) \\ +\mathbf{P}_{\pi,21} (\mathbf{\phi}) & \mathbf{P}_{\pi,22} (\mathbf{\phi}) +\end{pmatrix} \,, +\] +where the blocks have sizes conforming to the lengths of $\delta_{\mbox{{\scriptsize {\tt hlist}}} \setminus [h_i]}^i$ and $\delta_{[h_i]}^i$ in the obvious manner. The precision matrix of $\mathbf{\delta}_{[h_i]}^i$ is therefore +\[ +\mathbf{P}_i (\mathbf{\phi}) = \mathbf{P}_{\pi,22} (\mathbf{\phi}) - \mathbf{P}_{\pi,21} (\mathbf{\phi}) \mathbf{P}_{\pi,11}^{-1} (\mathbf{\phi}) \mathbf{P}_{\pi,21}^T (\mathbf{\phi}) \,. +\] +With this development, our prior assumption on the random effects is that given parameters $\mathbf{\phi}$, the $\delta_{[h_i]}^i$ are independently mean-zero Gaussian distributed having precision matrices $\mathbf{P}_i (\mathbf{\phi})$ for $i \in \mathcal{M}$. The upper triangular Cholesky factor $\mathbf{R}_i (\mathbf{\phi})$ of $\mathbf{P}_i (\mathbf{\phi})$ --- used in computing the multivariate Gaussian density function in the log-prior function given below --- is obtained from the upper triangular Cholesky factor of $\mathbf{\Pi} \, \mathbf{P}(\mathbf{\phi}) \, \mathbf{\Pi}^T$ by noting that $\mathbf{R}_i (\mathbf{\phi})$ is equal to the block associated with $\delta_{[h_i]}^i$. + +\vspace{5mm} + +\noindent +To complete the prior specification, we assume that $\mathbf{\theta}$ is distributed as $\pi_\theta (\mathbf{\theta})$, $\lambda_1, \ldots, \lambda_M$ are independently distributed as $\pi_{\lambda_i} (\lambda_i)$ for $i =1, \ldots, M$, and $\mathbf{\phi}$ is distributed as $\pi_\phi (\mathbf{\phi})$. Several options for specification of these distributions are available in the code. + +\vspace{5mm} + +\noindent +In the following, we let $|[h_i]|$ denote the number of elements contained in the set $[h_i]$. Noting that in addition to the above specification, the parameters $\mathbf{\theta}$, $\left\{ \delta_{[h_i]}^i \right\}_{i \in \mathcal{M}}$ given $\mathbf{\phi}$, $\{ \lambda_1, \ldots, \lambda_M \}$, and $\mathbf{\phi}$ are mutually independently distributed, the log-prior function is given by +\begin{align*} +\MoveEqLeft p \left( \, \mathbf{\theta}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \lambda_1, \ldots, \lambda_M, \mathbf{\phi} \, \right) \\ +=& -\frac{1}{2} \left( \log(2 \pi) \sum_{i \in \mathcal{M}} |[h_i]| - 2\sum_{i \in \mathcal{M}} \log \left( \left| \mathbf{R}_i (\mathbf{\phi}) \right| \right) + \sum_{i \in \mathcal{M}} \left( \mathbf{R}_i (\mathbf{\phi}) \mathbf{\delta}_{[h_i]}^i \right)^T \left( \mathbf{R}_i (\mathbf{\phi}) \mathbf{\delta}_{[h_i]}^i \right) \right) +\\ +& \log \left( \pi_{\theta} (\mathbf{\theta}) \right) + \sum_{i=1}^M \log \left( \pi_{\lambda_i} \left( \lambda_i \right) \right) + \log \left( \pi_\phi ( \mathbf{\phi} ) \right) \,. +\end{align*} +Neglecting constant terms, +\begin{align*} +\MoveEqLeft[10] p \left( \, \mathbf{\theta}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \lambda_1, \ldots, \lambda_M, \mathbf{\phi} \, \right) \\ +=& \sum_{i \in \mathcal{M}} \log \left( \left| \mathbf{R}_i (\mathbf{\phi}) \right| \right) - \frac{1}{2} \sum_{i \in \mathcal{M}} \left( \mathbf{R}_i (\mathbf{\phi}) \mathbf{\delta}_{[h_i]}^i \right)^T \left( \mathbf{R}_i (\mathbf{\phi}) \mathbf{\delta}_{[h_i]}^i \right) +\\ +& \log \left( \pi_{\theta} (\mathbf{\theta}) \right) + \sum_{i=1}^M \log \left( \pi_{\lambda_i} \left( \lambda_i \right) \right) + \log \left( \pi_\phi ( \mathbf{\phi} ) \right) \,. +\end{align*} + +\section{Log-Posterior Function} + +The adaptive MCMC algorithm samples the posterior distribution of the unconstrained parameters $\left\{ \mathbf{\tau}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \omega_1, \ldots, \omega_M, \mathbf{\phi} \right\}$. We compute the log-posterior function utilized in this algorithm as follows: +\begin{align*} +\MoveEqLeft \pi \left( \, \mathbf{\tau}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \omega_1, \ldots, \omega_M, \mathbf{\phi} \, | \, \mathbf{y}_1, \ldots, \mathbf{y}_M \, \right) \\ +=&~\ell \left( \, \mathbf{\theta}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \lambda_1, \ldots, \lambda_M \, | \, \mathbf{y}_1, \ldots, \mathbf{y}_M \, \right) + p \left( \, \mathbf{\theta}, \left\{ \mathbf{\delta}_{[h_i]}^i \right\}_{i \in \mathcal{M}}, \lambda_1, \ldots, \lambda_M, \mathbf{\phi} \, \right) +\\ +& \sum_{i=1}^{n_\theta} \log \left( \mbox{abs}\left( \frac{\partial f_i^{-1} (\tau_i)}{\partial \tau_i} \right) \right) + \sum_{i=1}^M \log \left( \lambda_i \right) \,. +\end{align*} +The last line in this equation arises from the Jacobian of the transformation $\left( \mathbf{\theta}, \left\{\lambda_1, \ldots, \lambda_M \right\} \right) \rightarrow \left( \mathbf{\tau}, \left\{ \omega_1, \ldots, \omega_M \right\} \right)$. + +\end{document} \ No newline at end of file From febac8640cfec7747807e0c3d0d9054c199b88a6 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Sat, 29 Nov 2014 22:41:51 -0600 Subject: [PATCH 05/99] Fix some errors generated by configure.ac --- configure.ac | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 6f39f8bb0..eb59385d1 100644 --- a/configure.ac +++ b/configure.ac @@ -198,26 +198,38 @@ AC_CONFIG_FILES([ test/test_infinite/inf_options test/test_Regression/GaussianMean1DRegression_options test/test_Regression/gpmsa_cobra_input.txt - test/test_Regression/test_cobra_samples_diff.sh test/test_Regression/test_gpmsa_cobra_samples.m test/test_Regression/ctf_dat.txt test/test_Regression/dakota_pstudy.dat - test/test_StatisticalInverseProblem/test_LlhdTargetOutput.sh test/test_StatisticalInverseProblem/both_input.txt test/test_StatisticalInverseProblem/llhdout_input.txt test/test_StatisticalInverseProblem/neither_input.txt test/test_StatisticalInverseProblem/targetout_input.txt test/test_Regression/jeffreys_input.txt - test/test_Regression/test_jeffreys_samples_diff.sh test/test_Regression/test_jeffreys_samples.m test/test_Regression/adaptedcov_input.txt doxygen/Makefile doxygen/queso.dox doxygen/txt_common/about_vpath.page +]) + +AC_CONFIG_FILES([test/test_Regression/test_cobra_samples_diff.sh ], [ chmod +x test/test_Regression/test_cobra_samples_diff.sh +]) + +AC_CONFIG_FILES([ + test/test_StatisticalInverseProblem/test_LlhdTargetOutput.sh +], +[ chmod +x test/test_StatisticalInverseProblem/test_LlhdTargetOutput.sh +]) + +AC_CONFIG_FILES([ + test/test_Regression/test_jeffreys_samples_diff.sh +], +[ chmod +x test/test_Regression/test_jeffreys_samples_diff.sh ]) From 285ffb824656c6654bf52806e92ed0e259dab0a7 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Sat, 29 Nov 2014 22:42:03 -0600 Subject: [PATCH 06/99] Remove trailing whitespace --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index eb59385d1..05b113938 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. +# Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) AC_INIT([queso], [0.51.0], [queso-users@googlegroups.com]) @@ -133,7 +133,7 @@ AX_PATH_GLPK([4.35],[no]) AX_PATH_HDF5_NEW([1.8.0],[no]) # Check for ANN (external library) -# AX_PATH_ANN +# AX_PATH_ANN #### TODO: Make sure that the ANN uses L-infinity (Max) norm # Check for ANN feature @@ -184,7 +184,7 @@ AC_CONFIG_FILES([ src/contrib/ANN/Makefile src/contrib/ANN/test/Makefile src/core/inc/queso.h - examples/Makefile + examples/Makefile examples/infinite_dim/inverse_options examples/infinite_dim/parallel_inverse_options test/Makefile From a5d5f876d6ab945686bf41f2982ea15076827f16 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 9 Dec 2014 13:51:16 -0600 Subject: [PATCH 07/99] Fix broken refs in users manual --- manual/users/users_5a_example_sip.tex | 43 +++++++++++++++++++- manual/users/users_5b_example_sfp.tex | 43 +++++++++++++++++++- manual/users/users_5c_example_gravity.tex | 47 ++++++++++++++++++++-- manual/users/users_5e_example_ml_modal.tex | 45 ++++++++++++++++++++- 4 files changed, 170 insertions(+), 8 deletions(-) diff --git a/manual/users/users_5a_example_sip.tex b/manual/users/users_5a_example_sip.tex index a1cb904ca..0f6551a19 100644 --- a/manual/users/users_5a_example_sip.tex +++ b/manual/users/users_5a_example_sip.tex @@ -174,7 +174,48 @@ \subsection{Create your own Makefile}\label{sec:sip-makefile} Makefiles are special format files that together with the make utility will help one to compile and automatically build and manage projects (programs). Listing \ref{code:ip_makefile} presents a Makefile, named `\texttt{Makefile\_sip\_example\_margarida}', that may be used to compile the code and create the executable \verb+simple_sip_example+. Naturally, it must be adapted to the user's settings, i.e., it has to have the correct paths for the user's libraries that have actually been used to compile and install QUESO (see Sections \ref{sec:Pre_Queso}--\ref{sec:install_Queso_make}). -\lstinputlisting[caption={Makefile for the application code in Listings \ref{code:sip-main-c}-\ref{code:sip-compute-c}}, label={code:ip_makefile},language={bash}]{../../examples/simpleStatisticalInverseProblem/src/Makefile_sip_example_margarida} +\begin{lstlisting}[caption={Makefile for the application code in Listings + \ref{code:sip-main-c}-\ref{code:sip-compute-c}}, + language=bash, + label={code:ip_makefile}] + QUESO_DIR = /path/to/queso + BOOST_DIR = /path/to/boost + GSL_DIR = /path/to/gsl + + INC_PATHS = \ + -I. \ + -I$(QUESO_DIR)/include \ + -I$(BOOST_DIR)/include \ + -I$(GSL_DIR)/include + + LIBS = \ + -L$(QUESO_DIR)/lib -lqueso \ + -L$(BOOST_DIR)/lib -lboost_program_options \ + -L$(GSL_DIR)/lib -lgsl + + CXX = mpic++ + CXXFLAGS += -g -Wall -c + + default: all + + .SUFFIXES: .o .C + + all: example_sip + + clean: + rm -f *~ + rm -f *.o + rm -f simple_sip_example + + example_sip: example_main.o example_likelihood.o example_compute.o + $(CXX) example_main.o \ + example_likelihood.o \ + example_compute.o \ + -o simple_sip_example $(LIBS) + + %.o: %.C + $(CXX) $(INC_PATHS) $(CXXFLAGS) $< +\end{lstlisting} Thus, to compile, build and execute the code, the user just needs to run the following commands in the same directory where the files are: \begin{lstlisting} diff --git a/manual/users/users_5b_example_sfp.tex b/manual/users/users_5b_example_sfp.tex index 0b3287e1d..927360c77 100644 --- a/manual/users/users_5b_example_sfp.tex +++ b/manual/users/users_5b_example_sfp.tex @@ -113,7 +113,48 @@ \subsection{Create your own Makefile}\label{sec:sfp-makefile} Listing \ref{code:makefile} presents a Makefile, named `\texttt{Makefile\_sfp\_example\_margarida}', that may be used to compile the code and create the executable \verb+simple_sfp_example+. Naturally, it must be adapted to the user's settings, i.e., it has to have the correct paths for the user's libraries that have actually been used to compile and install QUESO. -\lstinputlisting[caption={Makefile for the application code in Listings \ref{code:sfp-main-c}--\ref{code:sfp-compute-c}}, label={code:sfp-makefile},language={bash}]{../../examples/simpleStatisticalForwardProblem/src/Makefile_sfp_example_margarida} +\begin{lstlisting}[caption={Makefile for the application code in Listings + \ref{code:sfp-main-c}--\ref{code:sfp-compute-c}}, + label={code:sfp-makefile}, + language={bash}] + QUESO_DIR = /path/to/queso + BOOST_DIR = /path/to/boost + GSL_DIR = /path/to/gsl + + INC_PATHS = \ + -I. \ + -I$(QUESO_DIR)/include \ + -I$(BOOST_DIR)/include \ + -I$(GSL_DIR)/include + + LIBS = \ + -L$(QUESO_DIR)/lib -lqueso \ + -L$(BOOST_DIR)/lib -lboost_program_options \ + -L$(GSL_DIR)/lib -lgsl + + CXX = mpic++ + CXXFLAGS += -g -Wall -c + + default: all + + .SUFFIXES: .o .C + + all: example_sfp + + clean: + rm -f *~ + rm -f *.o + rm -f simple_sfp_example + + example_sfp: simple_sfp_example_main.o simple_sfp_example_qoi.o simple_sfp_example_compute.o + $(CXX) simple_sfp_example_main.o \ + simple_sfp_example_qoi.o \ + simple_sfp_example_compute.o \ + -o simple_sfp_example $(LIBS) + + %.o: %.C + $(CXX) $(INC_PATHS) $(CXXFLAGS) $< +\end{lstlisting} Thus, to compile, build and execute the code, the user just needs to run the following commands in the same directory where the files are: \begin{lstlisting} diff --git a/manual/users/users_5c_example_gravity.tex b/manual/users/users_5c_example_gravity.tex index 8c5e657db..883402e3f 100644 --- a/manual/users/users_5c_example_gravity.tex +++ b/manual/users/users_5c_example_gravity.tex @@ -319,10 +319,49 @@ \subsection{Create your own Makefile}\label{sec:gravity-makefile} Listing \ref{code:makefile} presents a Makefile, named \texttt{Makefile\_example\_violeta}, that may be used to compile the code and create the executable \verb+gravity_gsl+. Naturally, it must be adapted to the user's settings, i.e., it has to have the correct paths for the user's libraries that were actually used to compile and install QUESO (see Sections \ref{sec:Pre_Queso}--\ref{sec:install_Queso_make}). -\lstinputlisting[caption={Makefile for the application code in Listings \ref{code:gravity_main}-\ref{code:gravity_like_C}}, label={code:makefile},language={bash}]{../../examples/gravity/src/Makefile_example_violeta} - - - +\begin{lstlisting}[caption={Makefile for the application code in Listings + \ref{code:gravity_main}-\ref{code:gravity_like_C}}, + label={code:makefile}, + language={bash}] + QUESO_DIR = /path/to/queso + BOOST_DIR = /path/to/boost + GSL_DIR = /path/to/gsl + + INC_PATHS = \ + -I. \ + -I$(QUESO_DIR)/include \ + -I$(BOOST_DIR)/include \ + -I$(GSL_DIR)/include + + LIBS = \ + -L$(QUESO_DIR)/lib -lqueso \ + -L$(BOOST_DIR)/lib -lboost_program_options \ + -L$(GSL_DIR)/lib -lgsl + + CXX = mpic++ + CXXFLAGS += -g -Wall -c + + default: all + + .SUFFIXES: .o .C + + all: example_gravity_gsl + + clean: + rm -f *~ + rm -f *.o + rm -f gravity_gsl + + example_gravity_gsl: gravity_main.o gravity_likelihood.o gravity_compute.o gravity_qoi.o + $(CXX) gravity_main.o \ + gravity_likelihood.o \ + gravity_compute.o \ + gravity_qoi.o \ + -o gravity_gsl $(LIBS) + + %.o: %.C + $(CXX) $(INC_PATHS) $(CXXFLAGS) $< +\end{lstlisting} \subsection{Running the Gravity Example with Several Processors} diff --git a/manual/users/users_5e_example_ml_modal.tex b/manual/users/users_5e_example_ml_modal.tex index 00d8381d1..073d8f42b 100644 --- a/manual/users/users_5e_example_ml_modal.tex +++ b/manual/users/users_5e_example_ml_modal.tex @@ -188,9 +188,50 @@ \subsection{Input File}\label{sec:modal-input-file} \subsection{Create your own Makefile}\label{sec:modal-makefile} Makefiles are special format files that together with the make utility will help one to compile and automatically build and manage projects (programs). -Listing \ref{code:modal_makefile} presents a Makefile, named `\texttt{Makefile\_modal\_example\_margarida}', that may be used to compile the code and create the executable \verb+modal_gsl+. Naturally, it must be adapted to the user's settings, i.e., it has to have the correct paths for the user's libraries that have actually been used to compile and install QUESO (see Sections \ref{sec:Pre_Queso}--\ref{sec:install_Queso_make}). +Listing \ref{code:modal_makefile} presents a Makefile, named `\texttt{Makefile\_modal\_example\_violeta}', that may be used to compile the code and create the executable \verb+modal_gsl+. Naturally, it must be adapted to the user's settings, i.e., it has to have the correct paths for the user's libraries that have actually been used to compile and install QUESO (see Sections \ref{sec:Pre_Queso}--\ref{sec:install_Queso_make}). -\lstinputlisting[caption={Makefile for the application code in Listings \ref{code:modal-main-c}-\ref{code:modal-compute-c}}, label={code:modal_makefile},language={bash}]{../../examples/modal/src//Makefile_modal_violeta} +\begin{lstlisting}[caption={Makefile for the application code in Listings + \ref{code:modal-main-c}-\ref{code:modal-compute-c}}, + label={code:modal_makefile}, + language={bash}] + QUESO_DIR = /path/to/queso + BOOST_DIR = /path/to/boost + GSL_DIR = /path/to/gsl + + INC_PATHS = \ + -I. \ + -I$(QUESO_DIR)/include \ + -I$(BOOST_DIR)/include \ + -I$(GSL_DIR)/include + + LIBS = \ + -L$(QUESO_DIR)/lib -lqueso \ + -L$(BOOST_DIR)/lib -lboost_program_options \ + -L$(GSL_DIR)/lib -lgsl + + CXX = mpic++ + CXXFLAGS += -g -Wall -c + + default: all + + .SUFFIXES: .o .C + + all: modal_example_gsl + + clean: + rm -f *~ + rm -f *.o + rm -f modal_gsl + + modal_example_gsl: example_main.o example_likelihood.o example_compute.o + $(CXX) example_main.o \ + example_likelihood.o \ + example_compute.o \ + -o modal_gsl $(LIBS) + + %.o: %.C + $(CXX) $(INC_PATHS) $(CXXFLAGS) $< +\end{lstlisting} Thus, to compile, build and execute the code, the user just needs to run the following commands in the same directory where the files are: \begin{lstlisting} From 7859ad709530c9ebf15fba558bcbfd1b688925a4 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 9 Dec 2014 17:03:48 -0600 Subject: [PATCH 08/99] Document some of the filteredChain* options --- src/stats/inc/MetropolisHastingsSGOptions.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/stats/inc/MetropolisHastingsSGOptions.h b/src/stats/inc/MetropolisHastingsSGOptions.h index 49129e950..91e98c987 100644 --- a/src/stats/inc/MetropolisHastingsSGOptions.h +++ b/src/stats/inc/MetropolisHastingsSGOptions.h @@ -163,9 +163,28 @@ class MhOptionsValues bool m_rawChainComputeStats; #endif + //! Toggle the option to save a filtered chain. Default is 0 (off). + /*! + * A filtered chain is one where only every k-th sample is saved. Here k + * is called the 'lag' and can be set through m_filteredChainLag. + */ bool m_filteredChainGenerate; + + //! What initial fraction of the filtered chain is discarded. Default is 0. + /*! + * For example, if set to 0.2 then the first 20% of the filtered chain is + * discarded. Useful for discarding 'burn-in'. + */ double m_filteredChainDiscardedPortion; // input or set during run time + + //! Set the lag for the filtered chain. Default is 1. + /*! + * The lag is the number of samples to compute before saving. For example, + * if the lag is set to 20, then only every 20th sample is saved. + */ unsigned int m_filteredChainLag; // input or set during run time + + //! File name to save the filtered chain to. Default is ".". std::string m_filteredChainDataOutputFileName; std::string m_filteredChainDataOutputFileType; bool m_filteredChainDataOutputAllowAll; From 86a3d0521d72fa81f373dad08feab35f64f32e0a Mon Sep 17 00:00:00 2001 From: nicholasmalaya Date: Sun, 14 Dec 2014 12:57:22 -0600 Subject: [PATCH 09/99] [queso]: updating whitespace Hitting with an update but this is going to require more severe methods than I initially anticipated. YaTeX time. --- manual/users/users_5c_example_gravity.tex | 93 ++++++++++++++--------- 1 file changed, 59 insertions(+), 34 deletions(-) diff --git a/manual/users/users_5c_example_gravity.tex b/manual/users/users_5c_example_gravity.tex index 883402e3f..b134a80f1 100644 --- a/manual/users/users_5c_example_gravity.tex +++ b/manual/users/users_5c_example_gravity.tex @@ -1,23 +1,32 @@ \section{\texttt{gravity}}\label{sec:example_gravity} -This section presents an example of how to use QUESO in order to develop an application that solves a statistical inverse problem and -a statistical forward problem, where the solution of the former serves as input to the later. During the SIP, the acceleration due to gravity for an object in free fall near the surface of the Earth is inferred. During the SFP, the distance traveled by a projectile launched at a given angle and altitude is calculated using the calibrated magnitude of the acceleration of gravity. +This section presents an example of how to use QUESO in order to develop an application that solves a +statistical inverse problem (SIP) and a statistical forward problem (SFP), where the solution of the former +serves as input to the later. During the SIP, the acceleration due to gravity for an object in free +fall near the surface of the Earth is inferred. During the SFP, the distance traveled by a projectile +launched at a given angle and altitude is calculated using the calibrated magnitude of the acceleration of gravity. -In this section we describe a statistical forward problem of predicting the described in Section \ref{sec:gravity-ip}. +In this section we describe a statistical forward problem of predicting the described in Section +\ref{sec:gravity-ip}. \subsection{Statistical Inverse Problem}\label{sec:gravity-ip} -% Near the surface of the Earth, an object in free fall in a vacuum will accelerate at approximately $9.8 m/s^2$, independent of its mass. -% With air resistance acting upon an object that has been dropped, mass, drag coefficient and even relative surface may become important +% Near the surface of the Earth, an object in free fall in a vacuum will accelerate at approximately +% $9.8 m/s^2$, independent of its mass. +% With air resistance acting upon an object that has been dropped, mass, drag coefficient and even +% relative surface may become important % (if the fall is from sufficient altitude) in the calculation of gravity. -%The vertical motion of an object falling a small distance close to the surface of the planet can be approximated to have -%uniform gravitational field without air resistance, as long as the force of gravity on the object is much greater than the force of air resistance. +%The vertical motion of an object falling a small distance close to the surface of the planet can be +% approximated to have +%uniform gravitational field without air resistance, as long as the force of gravity on the object +% is much greater than the force of air resistance. %Therefore a convenient, simplified -A possible deterministic mathematical model for the vertical motion of an object in free fall near the surface of the Earth is given by +A possible deterministic mathematical model for the vertical motion of an object in free fall near the +surface of the Earth is given by \begin{equation}\label{eq:gravity01} h(t)=-\frac{1}{2} g t^2 + v_0 t + h_0. \end{equation} @@ -26,14 +35,16 @@ \subsection{Statistical Inverse Problem}\label{sec:gravity-ip} $h_0$ [$m$] is the initial altitude, $h(t)$ [$m$] is the altitude with respect to time, $t$ [$s$] is the elapsed time, and -$g$ [$m/s^2$] is the magnitude of the acceleration due to gravity (the parameter which cannot be directly measured and will be statistically inferred). +$g$ [$m/s^2$] is the magnitude of the acceleration due to gravity +(the parameter which cannot be directly measured and will be statistically inferred). \subsubsection{Experimental Data} -We assume that the experiment of allowing an object to fall from different altitudes with zero initial velocity has been repeatedly conducted (See Figure \ref{fig:free_fall}). The data collected, e.g. $\mathbf{d}$, is displayed in Table \ref{table:data}; the standard deviations, $\sigma$'s, refer to the uncertainties in the measured times during the experiment execution~\cite{interactagram}. - - +We assume that the experiment of allowing an object to fall from different altitudes with zero initial +velocity has been repeatedly conducted (See Figure \ref{fig:free_fall}). The data collected, +e.g. $\mathbf{d}$, is displayed in Table \ref{table:data}; the standard deviations, $\sigma$'s, +refer to the uncertainties in the measured times during the experiment execution~\cite{interactagram}. \begin{figure}[!ht] \centering @@ -45,7 +56,8 @@ \subsubsection{Experimental Data} \begin{table}[htp]%% Data from data02.dat \caption{Measurement data $\mathbf{d}$ of size $n_d=14$. -The object falls from altitude $h_0$ in $t$ seconds, with standard deviation of $\sigma$ seconds in the time measurement~\cite{interactagram}. +The object falls from altitude $h_0$ in $t$ seconds, with standard deviation of $\sigma$ +seconds in the time measurement~\cite{interactagram}. } % \specialrule{.4pt}{10pt}{4pt} \vspace{-8pt} @@ -80,8 +92,10 @@ \subsubsection{Experimental Data} \subsubsection{The Prior RV, Likelihood and Posterior RV} -In a straightforward classical interpretation of Bayesian inference, the prior signifies the modeler's honest opinion about the unknown. -For the gravity inference problem, let's assume that gravity varies uniformly in the interval [8,11], or, in other words, we chose uniform prior distribution in that interval: +In a straightforward classical interpretation of Bayesian inference, the prior signifies the +modeler's honest opinion about the unknown. +For the gravity inference problem, let's assume that gravity varies uniformly in the +interval [8,11], or, in other words, we chose uniform prior distribution in that interval: \begin{equation}\label{eq-g-prior} \pi_{\text{prior}}=\mathcal{U}(8,11). @@ -100,9 +114,13 @@ \subsubsection{The Prior RV, Likelihood and Posterior RV} [\mathbf{y}(\boldsymbol{\theta})-\mathbf{d}] \right\}, \end{equation} -where $\mathbf{C}(\boldsymbol{\theta})$ is a given covariance matrix, $\mathbf{d}$ denotes experimental data, $\mathbf{y}(\boldsymbol{\theta})$ is the model output data. +where $\mathbf{C}(\boldsymbol{\theta})$ is a given covariance matrix, $\mathbf{d}$ denotes +experimental data, $\mathbf{y}(\boldsymbol{\theta})$ is the model output data. -Recalling the deterministic model for the acceleration of gravity (\ref{eq:gravity01}) with zero initial velocity, the information provided in Table \ref{table:data}, and Equation (\ref{eq:like02}); and, additionally, invoking the nomenclature used in Section \ref{sec:statistical_concepts}, we have: +Recalling the deterministic model for the acceleration of gravity (\ref{eq:gravity01}) +with zero initial velocity, the information provided in Table \ref{table:data}, and +Equation (\ref{eq:like02}); and, additionally, invoking the nomenclature used in Section +\ref{sec:statistical_concepts}, we have: \begin{equation}\label{eq:like03} \boldsymbol{\theta} \stackrel{\text{\small{def.}}}{=} g, %------------ @@ -141,7 +159,8 @@ \subsubsection{The Prior RV, Likelihood and Posterior RV} \end{equation} where $n_d=14$ is the number of data points in Table \ref{table:data}. -Now we are ready to evoke Bayes' formula in order to obtain the posterior PDF $\pi_{\text{post}}(\boldsymbol{\theta})$: +Now we are ready to evoke Bayes' formula in order to obtain the posterior PDF +$\pi_{\text{post}}(\boldsymbol{\theta})$: \begin{equation}\label{eq-Bayes-g} \pi_{\text{post}}(\boldsymbol{\theta}|\mathbf{d})\varpropto \pi_{\text{like}}(\mathbf{d}|\boldsymbol{\theta}) \, \pi_{\text{prior}}(\boldsymbol{\theta}). \end{equation} @@ -149,11 +168,14 @@ \subsubsection{The Prior RV, Likelihood and Posterior RV} \subsection{Statistical Forward Problem} +Projectile motion refers to the motion of an object projected into the air at an angle, e.g. a soccer ball +being kicked, a baseball being thrown, or an athlete long jumping. Supposing the object does not have a +propulsion system and neglecting air resistance, then the only force acting on the object is a +constant gravitational acceleration $g$. -Projectile motion refers to the motion of an object projected into the air at an angle, e.g. a soccer ball being kicked, a baseball being thrown, or an athlete long jumping. Supposing the object does not have a propulsion system and neglecting air resistance, then the only force acting on the object is a constant gravitational acceleration $g$. - -A possible deterministic two-dimensional mathematical model for the vertical motion of an object projected from near the surface of the Earth is given by +A possible deterministic two-dimensional mathematical model for the vertical motion of an object projected +from near the surface of the Earth is given by \begin{align}\label{eq:fwd01} v_x &= v_{0x} \\ %&= v_{0} \cos(\alpha), \\ v_y &= v_{0y} - gt \\ %&= v_{0} \sin(\alpha) - gt,\\ @@ -161,8 +183,8 @@ \subsection{Statistical Forward Problem} h &= h_0 + v_{0y}t - \frac{1}{2} g t^2 %&= v_{0} \sin(\alpha) t - \frac{1}{2} g t^2. \end{align} where -$h_0$ is the initial height, $x=x(t)$ is the distance traveled by the object, $\bv{v_0}=(v_{0x},v_{0y})$ is the initial velocity, -$v_{0x} = v_{0} \cos(\alpha)$, $v_{0y} = v_{0} \sin(\alpha)$, and $v_0=\|\bv{v_0}\|^2$. +$h_0$ is the initial height, $x=x(t)$ is the distance traveled by the object, $\bv{v_0}=(v_{0x},v_{0y})$ +is the initial velocity, $v_{0x} = v_{0} \cos(\alpha)$, $v_{0y} = v_{0} \sin(\alpha)$, and $v_0=\|\bv{v_0}\|^2$. % Figure \ref{fig:projectile} displays the projectile motion of an object in these conditions. \begin{figure}[!ht] @@ -174,26 +196,28 @@ \subsection{Statistical Forward Problem} \end{figure} -%Assume that we want to describe the motion of such an object, starting at time $t = 0$, ... and velocity that makes an angle $\alpha$ with the $x$-axis. - +For this example, we assume that $h_0 =0$ m, $\alpha = \pi/4$ radians, $v_0 = 5$ m/s, all +deterministic variables; and $g$ is the solution of the SIP described in Section \ref{sec:gravity-ip}. -For this example, we assume that $h_0 =0$ m, $\alpha = \pi/4$ radians, $v_0 = 5$ m/s, all deterministic variables; and $g$ is the solution of the SIP described in Section \ref{sec:gravity-ip}. - -Since a PDF is assigned to parameter $g$; thus, the output of the mathematical model (\ref{eq:fwd01}) becomes a random variable, thus we have a statistical forward problem. +Since a PDF is assigned to parameter $g$; thus, the output of the mathematical model (\ref{eq:fwd01}) +becomes a random variable, thus we have a statistical forward problem. \subsubsection{The Input RV, QoI Function and Output RV} -The input random variable for the statistical forward problem is the acceleration of gravity $g$, which is also the solution (posterior PDF) of the inverse problem described in Section \ref{sec:gravity-ip}. The output random variable for this example is the distance $x$ traveled by an object in projectile motion. Note that, since there is uncertainty in the parameter $g$ ($g$ is given as a PDF), one can expect that this uncertainty will be propagated to $x$, which will also be given as a PDF. - -Combining the expressions in Equation \ref{eq:fwd01} and rearranging them, we have that QoI function for $x$ %(i.e. the final model for the distance traveled by an object in projectile motion) +The input random variable for the statistical forward problem is the acceleration of gravity $g$, +which is also the solution (posterior PDF) of the inverse problem described in Section \ref{sec:gravity-ip}. +The output random variable for this example is the distance $x$ traveled by an object in projectile motion. +Note that, since there is uncertainty in the parameter $g$ ($g$ is given as a PDF), one can +expect that this uncertainty will be propagated to $x$, which will also be given as a PDF. + +Combining the expressions in Equation \ref{eq:fwd01} and rearranging them, we have that QoI +function for $x$ %(i.e. the final model for the distance traveled by an object in projectile motion) is: \begin{equation}\label{eq:fp_deterministic} x=\dfrac{ v_0 \cos \alpha }{g} \left( v_0 \sin \alpha + \sqrt{ ( v_0 \sin \alpha)^2 + 2g\, y_0 }\right). \end{equation} where $y$ is the distance traveled and our quantity of interest (QoI). - - \subsection{Running the Example}\label{sec:gravity-run} To run the executable provided (available after QUESO installation), enter the following commands: @@ -255,7 +279,8 @@ \subsection{Running the Example}\label{sec:gravity-run} \end{lstlisting} -In order to generate chain plots, histograms, KDEs, etc., the user may use Matlab/GNU Octave and call the following command lines: +In order to generate chain plots, histograms, KDEs, etc., the user may use Matlab/GNU Octave and call +the following command lines: \begin{lstlisting} $ matlab $ gravity_plots_ip # inside matlab From 867cbdef357bf34cb075d935bf7999ffecf6e8ab Mon Sep 17 00:00:00 2001 From: nicholasmalaya Date: Sun, 14 Dec 2014 13:14:09 -0600 Subject: [PATCH 10/99] YaTeX fixing line-wrap --- manual/users/users_5c_example_gravity.tex | 128 ++++++++++++++-------- 1 file changed, 83 insertions(+), 45 deletions(-) diff --git a/manual/users/users_5c_example_gravity.tex b/manual/users/users_5c_example_gravity.tex index b134a80f1..e62520318 100644 --- a/manual/users/users_5c_example_gravity.tex +++ b/manual/users/users_5c_example_gravity.tex @@ -296,15 +296,23 @@ \subsection{Running the Example}\label{sec:gravity-run} sip_gravity_kde_filt.png sip_gravity_kde_raw.png \end{lstlisting} -As a result, the user should have created several of PNG figures containing marginal posterior PDF, chain positions of the parameters and the QoI, histogram, cumulative density distribution and autocorrelation. The name of the figure files have been chosen to be informative, as shown in the Listing above. +As a result, the user should have created several of PNG figures containing marginal posterior PDF, +chain positions of the parameters and the QoI, histogram, cumulative density distribution and +autocorrelation. The name of the figure files have been chosen to be informative, as shown in the listing above. \subsection{Example Code}\label{sec:gravity_code} The source code for the SIP and the SFP is composed of 7 files. -Three of them are common for both problems: \texttt{gravity\_main.C, gravity\_compute.h} and \texttt{gravity\_compute.C}; they combine both problems and use the solution of the SIP (the posterior PDF for the gravity) as an input for the SFP and are presented, respectively, in Listings \ref{code:gravity_main}, \ref{code:gravity_compute_h} and \ref{code:gravity_compute_C}. -Two of files specifically handle the SIP: \texttt{gravity\_likelihood.h}, and \texttt{gravity\_likelihood.C}, and are displayed in Listings \ref{code:gravity_like_h} and \ref{code:gravity_like_C}. Finally, the files specific for the SFP are \texttt{gravity\_qoi.h} and \texttt{gravity\_qoi.C}, and they are presented in Listings \ref{code:gravity_qoi_h} and \ref{code:gravity_qoi_C}. +Three of them are common for both problems: \texttt{gravity\_main.C, gravity\_compute.h} and +\texttt{gravity\_compute.C}; they combine both problems and use the solution of the SIP +(the posterior PDF for the gravity) as an input for the SFP and are presented, respectively, +in Listings \ref{code:gravity_main}, \ref{code:gravity_compute_h} and \ref{code:gravity_compute_C}. +Two of files specifically handle the SIP: \texttt{gravity\_likelihood.h}, and \texttt{gravity\_likelihood.C}, +and are displayed in Listings \ref{code:gravity_like_h} and \ref{code:gravity_like_C}. Finally, the files +specific for the SFP are \texttt{gravity\_qoi.h} and \texttt{gravity\_qoi.C}, and they are presented in +Listings \ref{code:gravity_qoi_h} and \ref{code:gravity_qoi_C}. \lstinputlisting[caption=File \texttt{gravity\_main.C.}, label=code:gravity_main, linerange={25-1000}]{../../examples/gravity/src/gravity_main.C} @@ -323,26 +331,32 @@ \subsection{Example Code}\label{sec:gravity_code} \subsection{Input File}\label{sec:gravity-input-file} QUESO reads an input file for solving statistical problems. -In the case of a SIP, it expects a list of options for MCMC, while in case of SFP it expects a list of options for Monte Carlo. The input file `\texttt{gravity\_inv\_fwd.inp} used in this example is presented in Listing \ref{code:gravity_inv_fwd}. +In the case of a SIP, it expects a list of options for MCMC, while in case of SFP it expects a list of +options for Monte Carlo. The input file `\texttt{gravity\_inv\_fwd.inp} used in this example is +presented in Listing \ref{code:gravity_inv_fwd}. \lstinputlisting[caption=Some options for QUESO library used in application code (Listings \ref{code:gravity_main}-\ref{code:gravity_like_C})., label={code:gravity_inv_fwd},]{../../examples/gravity/tests/test_2013_01_22/gravity_inv_fwd.inp} -Moreover, for the gravity inverse problem, one may notice that QUESO will use the Metropolis-Hastings algorithm to sample the posterior PDF +Moreover, for the gravity inverse problem, one may notice that QUESO will use the Metropolis-Hastings algorithm +to sample the posterior PDF (indicated by the prefix \texttt{mh\_}in the variable names) without adaptive steps -(indicated by the zero value assigned to the variable \linebreak \texttt{ip\_mh\_am\_initialNonAdaptInterval}, which can also be achieved by setting zero to \linebreak -\verb+ip_mh_am_adaptInterval+) and with delayed rejection (indicated by the one-value assigned to the variable \texttt{ip\_mh\_dr\_maxNumExtraStages}). +(indicated by the zero value assigned to the variable \linebreak \texttt{ip\_mh\_am\_initialNonAdaptInterval}, +which can also be achieved by setting zero to \linebreak +\verb+ip_mh_am_adaptInterval+) and with delayed rejection (indicated by the one-value assigned to the +variable \texttt{ip\_mh\_dr\_maxNumExtraStages}). \subsection{Create your own Makefile}\label{sec:gravity-makefile} - - -Listing \ref{code:makefile} presents a Makefile, named \texttt{Makefile\_example\_violeta}, that may be used to compile the code and create the executable \verb+gravity_gsl+. Naturally, it must be adapted to the user's settings, i.e., it has to have the correct paths for the user's libraries that were actually used to compile and install QUESO (see Sections \ref{sec:Pre_Queso}--\ref{sec:install_Queso_make}). +Listing \ref{code:makefile} presents a Makefile, named \texttt{Makefile\_example\_violeta}, that may be +used to compile the code and create the executable \verb+gravity_gsl+. Naturally, it must be adapted +to the user's settings, i.e., it has to have the correct paths for the user's libraries that were actually +used to compile and install QUESO (see Sections \ref{sec:Pre_Queso}--\ref{sec:install_Queso_make}). \begin{lstlisting}[caption={Makefile for the application code in Listings \ref{code:gravity_main}-\ref{code:gravity_like_C}}, @@ -390,10 +404,15 @@ \subsection{Create your own Makefile}\label{sec:gravity-makefile} \subsection{Running the Gravity Example with Several Processors} -Even though the application described in Section \ref{sec:gravity_code} is a serial code, it is possible to run it using more than one processor, i.e., in parallel mode. -Supposing the user's workstation has $N_p=8$ processors, then, the user my choose to have $N_s =$ 8, 4 or 2 subenvironments. This complies with the requirement that the total number of processors in the environment must be a multiple of the specified number of subenvironments. +Even though the application described in Section \ref{sec:gravity_code} is a serial code, it is +possible to run it using more than one processor, i.e., in parallel mode. +Supposing the user's workstation has $N_p=8$ processors, then, the user my choose to have $N_s =$ +8, 4 or 2 subenvironments. This complies with the requirement that the total number of processors +in the environment must be a multiple of the specified number of subenvironments. -Thus, to build and run the application code with $N_p = 8$, and $N_s=8$ subenvironments, the must set the variable \texttt{env\_numSubEnvironments = 8} in the input file (Listing~\ref{code:gravity_inv_fwd}) and enter the following command lines: +Thus, to build and run the application code with $N_p = 8$, and $N_s=8$ subenvironments, the must +set the variable \texttt{env\_numSubEnvironments = 8} in the input file +(Listing~\ref{code:gravity_inv_fwd}) and enter the following command lines: @@ -416,7 +435,8 @@ \subsection{Data Post-Processing and Visualization}\label{sec:gravity-results} -According to the specifications of the input file in Listing~\ref{code:gravity_inv_fwd}, both a folder named \verb+outputData+ and a the following files should be generated: +According to the specifications of the input file in Listing~\ref{code:gravity_inv_fwd}, +both a folder named \verb+outputData+ and a the following files should be generated: \begin{verbatim} sfp_gravity_sub0.m, sip_gravity_sub0.m, sfp_gravity_p_seq.m, sip_gravity_filtered_chain.m,, @@ -426,24 +446,30 @@ \subsection{Data Post-Processing and Visualization}\label{sec:gravity-results} display_env_sub0.txt \end{verbatim} -%The names of the files have been chosen to be informative. - - -%In this case, only one sub-environment (processor) has been used, thus, only one file of the type \verb+display_env_sub*+ is generated. -% - -In this section, a convenient capability of QUESO of internally handling possible conflicts in chain size is presented. Recalling the input file \verb+gravity_inv_fwd.inp+ presented in Listing~\ref{code:gravity_inv_fwd}, one may notice that the raw chain size for the SIP is chosen to have 20000 positions (\verb+ip_mh_rawChain_size = 20000+); the lag of the filtered chain is chosen to be 20 (\verb+ip_mh_filteredChain_lag = 20+) and the chain size for the SFP has 16384 positions (\verb+fp_mc_qseq_size = 16384+). Because the solution of the SIP, ie, the posterior PDF, is used as input PDF for the SFP, QUESO internally sets \verb+fp_mc_qseq_size = 20000+, as can be seen in the file \verb+display_env_sub0.txt+. The file \verb+display_env_sub0.txt+ contains information from the subenvironment `0' that was generated during the run of the application code. +In this section, a convenient capability of QUESO of internally handling possible conflicts in +chain size is presented. Recalling the input file \verb+gravity_inv_fwd.inp+ presented in +Listing~\ref{code:gravity_inv_fwd}, one may notice that the raw chain size for the SIP is +chosen to have 20000 positions (\verb+ip_mh_rawChain_size = 20000+); the lag of the filtered chain +is chosen to be 20 (\verb+ip_mh_filteredChain_lag = 20+) and the chain size for the SFP has 16384 +positions (\verb+fp_mc_qseq_size = 16384+). Because the solution of the SIP, ie, the posterior PDF, +is used as input PDF for the SFP, QUESO internally sets \verb+fp_mc_qseq_size = 20000+, as can be +seen in the file \verb+display_env_sub0.txt+. The file \verb+display_env_sub0.txt+ contains information +from the subenvironment `0' that was generated during the run of the application code. \subsubsection{Statistical Inverse Problem} -There are a few Matlab-ready commands that are very helpful tools for post-processing the data generated by QUESO when solving statistical inverse problems. -This section discusses the results computed by QUESO with the code of Section \ref{sec:gravity_code}, and shows how to use Matlab for the post-processing of such results. +There are a few Matlab-ready commands that are very helpful tools for post-processing the data +generated by QUESO when solving statistical inverse problems. +This section discusses the results computed by QUESO with the code of Section +\ref{sec:gravity_code}, and shows how to use Matlab for the post-processing of such results. \paragraph{Chain Plots}\ -It is quite simple to plot, using Matlab, the chain of positions used in the DRAM algorithm implemented within QUESO. -The sequence of Matlab commands presented in Listing \ref{matlab:chain} generates the graphic depicted in Figure \ref{fig:sip_gravity_chain_pos_raw}. -Figure~\ref{fig:sip_gravity_chain_pos_filtered} is obtained analogously. % by loading \verb+sip_gravity_filtered_chain+ and using \verb+ip_mh_filtChain_unified+ inside \verb+plot+. +It is quite simple to plot, using Matlab, the chain of positions used in the DRAM algorithm +implemented within QUESO. +The sequence of Matlab commands presented in Listing \ref{matlab:chain} generates the +graphic depicted in Figure \ref{fig:sip_gravity_chain_pos_raw}. +Figure~\ref{fig:sip_gravity_chain_pos_filtered} is obtained analogously. \begin{lstlisting}[label=matlab:chain,caption={Matlab code for the chain plot.}] % inside Matlab @@ -464,10 +490,9 @@ \subsubsection{Statistical Inverse Problem} \paragraph{Histogram Plots}\ -In order to plot histograms of the parameter using either the raw chain or the filtered chain, you simply have to use the pre-defined Matlab function \verb+hist+. -%The Matlab code presented in Listing \ref{matlab:hist} below shows how to create the Figure \ref{fig:sip_gravity_hist_raw}; -%once more, Figure \ref{fig:sip_gravity_hist_filtered} is obtained by making suitable adjustments on that code. -% +In order to plot histograms of the parameter using either the raw chain or the filtered chain, +you simply have to use the pre-defined Matlab function \verb+hist+. + \begin{lstlisting}[label=matlab:hist,caption={Matlab code for the histogram plot.}] % inside Matlab >> sip_gravity_raw_chain @@ -489,7 +514,8 @@ \subsubsection{Statistical Inverse Problem} \paragraph{KDE Plots} \ -Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) together with the option \verb+'pdf'+ may be used for plotting the KDE of the parameter. +Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) together with the +option \verb+'pdf'+ may be used for plotting the KDE of the parameter. \begin{lstlisting}[label=matlab:kde,caption={Matlab code for the KDE plot.}] % inside Matlab >> sip_gravity_raw_chain @@ -556,8 +582,8 @@ \subsubsection{Statistical Inverse Problem} \paragraph{CDF Plots} \ -Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) with \verb+'cdf'+ option may also be used for plotting the Cumulative Distribution Function of the parameter. - +Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) with \verb+'cdf'+ option +may also be used for plotting the Cumulative Distribution Function of the parameter. \begin{lstlisting}[label=matlab:cdf,caption={Matlab code for the CDF plot.}] % inside Matlab @@ -581,7 +607,8 @@ \subsubsection{Statistical Inverse Problem} \paragraph{Autocorrelation Plots}\ -The code presented in Listing \ref{matlab:autocorr} uses matlab function \verb+autocorr+ to generate Figure \ref{fig:sip_gravity_autocorrelation_raw_filt} +The code presented in Listing \ref{matlab:autocorr} uses matlab function \verb+autocorr+ to generate +Figure \ref{fig:sip_gravity_autocorrelation_raw_filt} which presents the autocorrelation of the parameter $g$ in both cases: raw and filtered chain. \begin{lstlisting}[label=matlab:autocorr,caption={Matlab code for the autocorrelation plots.}] @@ -611,8 +638,10 @@ \subsubsection{Statistical Inverse Problem} \paragraph{Covariance and Correlation Matrices}\ -Matlab function \verb+cov+ calculates the covariance matrix for a data matrix (where each column represents a separate quantity), and \verb+corr+ calculates the correlation matrix. -Since our statistical inverse problem has only one parameter (the acceleration $g$ due to gravity), both covariance and correlation matrices have dimension $1 \times 1$, i.e., they are scalars. +Matlab function \verb+cov+ calculates the covariance matrix for a data matrix +(where each column represents a separate quantity), and \verb+corr+ calculates the correlation matrix. +Since our statistical inverse problem has only one parameter (the acceleration $g$ due to gravity), +both covariance and correlation matrices have dimension $1 \times 1$, i.e., they are scalars. \begin{lstlisting}[label=matlab:cov_matrix,caption={Matlab code for finding the covariance matrix.}] % inside Matlab @@ -637,8 +666,10 @@ \subsubsection{Statistical Forward Problem} \paragraph{Chain Plots} \ -It is quite simple to plot, using Matlab, the chain of positions generated by the Monte Carlo algorithm implemented within QUESO and called during the solution of the statistical forward problem. -The sequence of Matlab commands presented bellow generates the graphic depicted in Figure~\ref{fig:sfp_gravity_chain}. +It is quite simple to plot, using Matlab, the chain of positions generated by the Monte Carlo algorithm +implemented within QUESO and called during the solution of the statistical forward problem. +The sequence of Matlab commands presented bellow generates the graphic depicted in +Figure~\ref{fig:sfp_gravity_chain}. \begin{lstlisting}[label=matlab:chain_qoi,caption={Matlab code for the chain plot.}] % inside Matlab @@ -682,7 +713,8 @@ \subsubsection{Statistical Forward Problem} \paragraph{KDE Plots} \ -Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) together with the option \verb+'pdf'+ may be used for plotting the KDE of the he QoI, displayed in Figure \ref{fig:sfp_gravity_kde}. +Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) together with the +option \verb+'pdf'+ may be used for plotting the KDE of the he QoI, displayed in Figure \ref{fig:sfp_gravity_kde}. \begin{lstlisting}[label=matlab:kde_qoi,caption={Matlab code for the QoI KDE plot.}] % inside Matlab @@ -707,7 +739,8 @@ \subsubsection{Statistical Forward Problem} \paragraph{CDF Plots} \ -Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) with \verb+'cdf'+ option may also be used for plotting the Cumulative Distribution Function of the QoI, displayed in Figure~\ref{fig:sfp_gravity_cdf}. +Matlab function \verb+ksdensity+ (Kernel smoothing density estimate) with \verb+'cdf'+ option may also be +used for plotting the Cumulative Distribution Function of the QoI, displayed in Figure~\ref{fig:sfp_gravity_cdf}. \begin{lstlisting}[label=matlab:cdf_qoi,caption={Matlab code for the QoI CDF plot.}] % inside Matlab @@ -737,7 +770,8 @@ \subsubsection{Statistical Forward Problem} \end{figure} \paragraph{Autocorrelation Plots} \ -The code presented in Listing \ref{matlab:autocorr_qoi} uses Matlab function \verb+autocorr+ to generate Figure~\ref{fig:sfp_gravity_autocorrelation}, which presents the autocorrelation of the QoI $d$. +The code presented in Listing \ref{matlab:autocorr_qoi} uses Matlab function \verb+autocorr+ +to generate Figure~\ref{fig:sfp_gravity_autocorrelation}, which presents the autocorrelation of the QoI $d$. \begin{lstlisting}[label=matlab:autocorr_qoi,caption={Matlab code for the QoI autocorrelation plot.}] % inside Matlab @@ -761,10 +795,12 @@ \subsubsection{Statistical Forward Problem} \paragraph{Covariance and Correlation Matrices} \ -For a matrix input \verb+X+, where each row is an observation, and each column is a variable, the Matlab function \verb+cov(X)+ may be used to calculate the covariance matrix. +For a matrix input \verb+X+, where each row is an observation, and each column is a +variable, the Matlab function \verb+cov(X)+ may be used to calculate the covariance matrix. %The command \verb+diag(cov(X))+ is a vector of variances for each column, and, therefore, \verb+sqrt(diag(cov(X)))+ is a vector of standard deviations. -Thus, in order to calculated the covariance matrix between the parameter and the quantity of interest sequences generated by Monte Carlo sampler with QUESO, +Thus, in order to calculated the covariance matrix between the parameter and the quantity of interest +sequences generated by Monte Carlo sampler with QUESO, one may simply define \verb+X=[fp_mc_ParamSeq_unified fp_mc_QoiSeq_unified]+. The code presented in Listing \ref{matlab:cov_pqoi} shows the usage of Matlab commands for finding such the matrix. @@ -781,8 +817,10 @@ \subsubsection{Statistical Forward Problem} \end{lstlisting} -Analogously, the Matlab function \verb+corrcoef(X)+ returns a matrix of correlation coefficients calculated from an input matrix \verb+X+ whose rows are observations and whose columns are variables. -In order to calculated the correlation matrix between the parameter and the QoI sequences, one may simply define \verb+X=[fp_mc_ParamSeq_unified fp_mc_QoiSeq_unified]+. +Analogously, the Matlab function \verb+corrcoef(X)+ returns a matrix of correlation coefficients +calculated from an input matrix \verb+X+ whose rows are observations and whose columns are variables. +In order to calculated the correlation matrix between the parameter and the QoI sequences, +one may simply define \verb+X=[fp_mc_ParamSeq_unified fp_mc_QoiSeq_unified]+. % The matrix R = corrcoef(X) is related to the covariance matrix C = cov(X) b \begin{lstlisting}[label=matlab:corr_param_qoi,caption={Matlab code for the matrix of correlation between parameter $g$ and quantity of interest $d$.}] From 2314d184f0ad12049749ee4b4ead0f451af72f7a Mon Sep 17 00:00:00 2001 From: nicholasmalaya Date: Sun, 14 Dec 2014 14:56:51 -0600 Subject: [PATCH 11/99] [queso]: fixing href links on title page --- doxygen/queso.page | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doxygen/queso.page b/doxygen/queso.page index d87d4a692..2f1f8910e 100644 --- a/doxygen/queso.page +++ b/doxygen/queso.page @@ -21,7 +21,7 @@ based/html format. Bugs in the code and errors or omissions in the documentation can be reported to queso-users@googlegroups.com or as a -GitHub ticket. Requests and contributions are also welcome using either of the two methods mentioned above. @@ -36,11 +36,10 @@ All bug reports should include: \section bugs Regression Testing
    -
  • Build\ -bot Coverage +
  • Build bot Coverage \section licence License -See here. \section acknowledgements Acknowledgments \copydoc Acknowledgments From 2cc2f5663a4e206e1a748a6c0f0075dd07fdc634 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 15 Dec 2014 16:40:42 -0600 Subject: [PATCH 12/99] Remove trailing whitespace --- examples/Makefile.am | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index 02e900a50..03b928cba 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -10,17 +10,17 @@ QUESO_CPPFLAGS += $(ANN_CFLAGS) LIBS += $(GSL_LIBS) if TRILINOS_ENABLED - QUESO_CPPFLAGS += -I$(TRILINOS_INCLUDE) + QUESO_CPPFLAGS += -I$(TRILINOS_INCLUDE) LIBS += -lteuchoscore -lteuchoscomm -lteuchosnumerics -lteuchosparameterlist -lteuchosremainder -lepetra endif -if GLPK_ENABLED +if GLPK_ENABLED QUESO_CPPFLAGS += $(GLPK_CFLAGS) LIBS += $(GLPK_LIBS) endif -if HDF5_ENABLED - QUESO_CPPFLAGS += $(HDF5_CFLAGS) +if HDF5_ENABLED + QUESO_CPPFLAGS += $(HDF5_CFLAGS) LIBS += $(HDF5_LIBS) endif @@ -98,11 +98,11 @@ exSimpleStatisticalInverseProblem_gsl_LDADD = $(top_builddir)/src/libqueso.la exSimpleStatisticalInverseProblem_gsl_CPPFLAGS = -I$(top_srcdir)/examples/simpleStatisticalInverseProblem/src $(QUESO_CPPFLAGS) # Make sure everything relevant gets added when doing 'make dist' -dist_exSimpleStatisticalInverseProblem_gsl_DATA = +dist_exSimpleStatisticalInverseProblem_gsl_DATA = dist_exSimpleStatisticalInverseProblem_gsl_DATA += ${exSimpleStatisticalInverseProblem_gsl_DATA} dist_exSimpleStatisticalInverseProblem_gsl_DATA += ${exSimpleStatisticalInverseProblem_gsl_HEADERS} dist_exSimpleStatisticalInverseProblem_gsl_DATA += ${exSimpleStatisticalInverseProblem_gsl_SOURCES} - + ################################### # simpleStatisticalForwardProblem # ################################### @@ -127,9 +127,9 @@ exSimpleStatisticalForwardProblem_gsl_CPPFLAGS = -I$(top_srcdir)/examples/simple dist_exSimpleStatisticalForwardProblem_gsl_DATA = ${exSimpleStatisticalForwardProblem_gsl_DATA} dist_exSimpleStatisticalForwardProblem_gsl_DATA += ${exSimpleStatisticalForwardProblem_gsl_HEADERS} dist_exSimpleStatisticalForwardProblem_gsl_DATA += ${exSimpleStatisticalForwardProblem_gsl_SOURCES} - + #################################### -# statisticalForwardProblemExample # +# statisticalForwardProblemExample # #################################### # Kemelli, 8/26/13: removing this example from the distro # exStatisticalForwardProblem_gsldir = $(prefix)/examples/statisticalForwardProblem @@ -293,7 +293,7 @@ dist_gravity_gsl_DATA = dist_gravity_gsl_DATA += $(gravity_gsl_DATA) dist_gravity_gsl_DATA += ${gravity_gsl_HEADERS} dist_gravity_gsl_DATA += ${gravity_gsl_SOURCES} - + #################### # bimodal # #################### From bd24ee7da932950ac348cb5fc2659c03e2f70f9d Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 15 Dec 2014 16:41:41 -0600 Subject: [PATCH 13/99] Remove trailing whitespace and update licence --- examples/gravity/src/gravity_compute.C | 225 ++++++++++--------------- 1 file changed, 90 insertions(+), 135 deletions(-) diff --git a/examples/gravity/src/gravity_compute.C b/examples/gravity/src/gravity_compute.C index b89ec418f..a8c212743 100644 --- a/examples/gravity/src/gravity_compute.C +++ b/examples/gravity/src/gravity_compute.C @@ -1,43 +1,43 @@ -/*------------------------------------------------------------------- - * - * Copyright (C) 2012 The PECOS Development Team - * - * Please see http://pecos.ices.utexas.edu for more information. - * - * This file is part of the QUESO Library (Quantification of Uncertainty - * for Estimation, Simulation and Optimization). - * - * QUESO is free software: you can redistribute it and/or modify - * it 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. - * - * QUESO 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. - * - * You should have received a copy of the GNU General Public License - * along with QUESO. If not, see . - * - *------------------------------------------------------------------- - * - */ - /*------------------------------------------------------------------ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +/* * This file is divided in two parts: - * - the first one handles the statistical inverse problem (SIP) for estimating the magnitude - * 'g' of gravity acceleration; and - * - the second part handles the statistical forward problem (SFP) for predicting the maximum - * distance traveled by a projectile. + * - the first one handles the statistical inverse problem (SIP) for estimating + * the magnitude 'g' of gravity acceleration; and + * - the second part handles the statistical forward problem (SFP) for + * predicting the maximum distance traveled by a projectile. * - * The SIP definition requires a user defined likelihood function; refer to files - * 'gravity_likelihood.h' and 'gravity_likelihood.C'. The SFP definition requires a user - * defined qoi function; refer to files 'gravity_qoi.h' and 'gravity_qoi.C'. - *-----------------------------------------------------------------*/ + * The SIP definition requires a user defined likelihood function; refer to + * files 'gravity_likelihood.h' and 'gravity_likelihood.C'. The SFP definition + * requires a user defined qoi function; refer to files 'gravity_qoi.h' and + * 'gravity_qoi.C'. + */ + +#include +#include -#include -#include -#include #include #include #include @@ -46,21 +46,14 @@ #include #include #include -#include -#include - -//================================================================ -// If PRIOR_IS_GAUSSIAN is defined, then: -// --> Gaussian prior for gravity. -// Otherwise: -// --> Uniform prior for gravity. -//================================================================ -//#define PRIOR_IS_GAUSSIAN +#include +#include +#include void computeGravityAndTraveledDistance(const QUESO::FullEnvironment& env) { struct timeval timevalNow; - + gettimeofday(&timevalNow, NULL); if (env.fullRank() == 0) { std::cout << "\nBeginning run of 'Gravity + Projectile motion' example at " @@ -73,7 +66,7 @@ void computeGravityAndTraveledDistance(const QUESO::FullEnvironment& env) { } // Just examples of possible calls - if ((env.subDisplayFile() ) && + if ((env.subDisplayFile() ) && (env.displayVerbosity() >= 2)) { *env.subDisplayFile() << "Beginning run of 'Gravity + Projectile motion' example at " << ctime(&timevalNow.tv_sec) @@ -81,7 +74,7 @@ void computeGravityAndTraveledDistance(const QUESO::FullEnvironment& env) { } env.fullComm().Barrier(); env.subComm().Barrier(); // Just an example of a possible call - + //================================================================ // Statistical inverse problem (SIP): find posterior PDF for 'g' //================================================================ @@ -95,153 +88,117 @@ void computeGravityAndTraveledDistance(const QUESO::FullEnvironment& env) { //------------------------------------------------------ // SIP Step 1 of 6: Instantiate the parameter space //------------------------------------------------------ - QUESO::VectorSpace paramSpace(env, "param_", 1, NULL); + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); //------------------------------------------------------ // SIP Step 2 of 6: Instantiate the parameter domain //------------------------------------------------------ QUESO::GslVector paramMinValues(paramSpace.zeroVector()); QUESO::GslVector paramMaxValues(paramSpace.zeroVector()); - + paramMinValues[0] = 8.; paramMaxValues[0] = 11.; - - QUESO::BoxSubset - paramDomain("param_", - paramSpace, - paramMinValues, - paramMaxValues); - + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMinValues, paramMaxValues); + //------------------------------------------------------ - // SIP Step 3 of 6: Instantiate the likelihood function + // SIP Step 3 of 6: Instantiate the likelihood function // object to be used by QUESO. //------------------------------------------------------ - likelihoodRoutine_Data likelihoodRoutine_Data(env); - QUESO::GenericScalarFunction - likelihoodFunctionObj("like_", - paramDomain, - likelihoodRoutine, - (void *) &likelihoodRoutine_Data, - true); // the routine computes [ln(function)] - + Likelihood lhood("like_", paramDomain); + //------------------------------------------------------ // SIP Step 4 of 6: Define the prior RV //------------------------------------------------------ - -#ifdef PRIOR_IS_GAUSSIAN - QUESO::GslVector meanVector( paramSpace.zeroVector() ); - meanVector[0] = 9; - - QUESO::GslMatrix covMatrix = QUESO::GslMatrix(paramSpace.zeroVector()); - covMatrix(0,0) = 1.; - - // Create a Gaussian prior RV - QUESO::GaussianVectorRV priorRv("prior_",paramDomain,meanVector,covMatrix); - -#else - // Create an uniform prior RV - QUESO::UniformVectorRV priorRv("prior_",paramDomain); - -#endif - + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + //------------------------------------------------------ // SIP Step 5 of 6: Instantiate the inverse problem //------------------------------------------------------ QUESO::GenericVectorRV postRv("post_", // Extra prefix before the default "rv_" prefix paramSpace); - + QUESO::StatisticalInverseProblem ip("", // No extra prefix before the default "ip_" prefix - NULL, - priorRv, - likelihoodFunctionObj, - postRv); + NULL, + priorRv, + lhood, + postRv); //------------------------------------------------------ // SIP Step 6 of 6: Solve the inverse problem, that is, // set the 'pdf' and the 'realizer' of the posterior RV //------------------------------------------------------ - std::cout << "Solving the SIP with Metropolis Hastings" - << std::endl << std::endl; QUESO::GslVector paramInitials(paramSpace.zeroVector()); priorRv.realizer().realization(paramInitials); QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); - proposalCovMatrix(0,0) = std::pow( fabs(paramInitials[0])/20. , 2. ); + proposalCovMatrix(0,0) = std::pow(std::abs(paramInitials[0]) / 20.0, 2.0); ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); //================================================================ - // Statistical forward problem (SFP): find the max distance - // traveled by an object in projectile motion; input pdf for 'g' + // Statistical forward problem (SFP): find the max distance + // traveled by an object in projectile motion; input pdf for 'g' // is the solution of the SIP above. //================================================================ gettimeofday(&timevalNow, NULL); - std::cout << "Beginning 'SFP -> Projectile motion' at " + std::cout << "Beginning 'SFP -> Projectile motion' at " << ctime(&timevalNow.tv_sec) << std::endl; - + //------------------------------------------------------ - // SFP Step 1 of 6: Instantiate the parameter *and* qoi spaces. + // SFP Step 1 of 6: Instantiate the parameter *and* qoi spaces. // SFP input RV = FIP posterior RV, so SFP parameter space // has been already defined. //------------------------------------------------------ - QUESO::VectorSpace qoiSpace(env, "qoi_", 1, NULL); - + QUESO::VectorSpace qoiSpace(env, "qoi_", + 1, NULL); + //------------------------------------------------------ - // SFP Step 2 of 6: Instantiate the parameter domain + // SFP Step 2 of 6: Instantiate the parameter domain //------------------------------------------------------ - - // Not necessary because input RV of the SFP = output RV of SIP. + + // Not necessary because input RV of the SFP = output RV of SIP. // Thus, the parameter domain has been already defined. - - //------------------------------------------------------ - // SFP Step 3 of 6: Instantiate the qoi function object + + //------------------------------------------------------ + // SFP Step 3 of 6: Instantiate the qoi object // to be used by QUESO. //------------------------------------------------------ - qoiRoutine_Data qoiRoutine_Data; - qoiRoutine_Data.m_angle = M_PI/4.0; //45 degrees (radians) - qoiRoutine_Data.m_initialVelocity= 5.; //initial speed (m/s) - qoiRoutine_Data.m_initialHeight = 0.; //initial height (m) - - QUESO::GenericVectorFunction - qoiFunctionObj("qoi_", - paramDomain, - qoiSpace, - qoiRoutine, - (void *) &qoiRoutine_Data); - + Qoi + qoi("qoi_", paramDomain, qoiSpace); + //------------------------------------------------------ // SFP Step 4 of 6: Define the input RV //------------------------------------------------------ - - // Not necessary because input RV of SFP = output RV of SIP + + // Not necessary because input RV of SFP = output RV of SIP // (postRv). - + //------------------------------------------------------ // SFP Step 5 of 6: Instantiate the forward problem //------------------------------------------------------ - QUESO::GenericVectorRV qoiRv("qoi_", qoiSpace); - - QUESO::StatisticalForwardProblem - fp("", - NULL, - postRv, - qoiFunctionObj, - qoiRv); + QUESO::GenericVectorRV qoiRv("qoi_", + qoiSpace); + + QUESO::StatisticalForwardProblem fp("", NULL, postRv, qoi, qoiRv); //------------------------------------------------------ // SFP Step 6 of 6: Solve the forward problem //------------------------------------------------------ - std::cout << "Solving the SFP with Monte Carlo" - << std::endl << std::endl; + std::cout << "Solving the SFP with Monte Carlo" + << std::endl << std::endl; fp.solveWithMonteCarlo(NULL); - //------------------------------------------------------ gettimeofday(&timevalNow, NULL); - if ((env.subDisplayFile() ) && + if ((env.subDisplayFile() ) && (env.displayVerbosity() >= 2)) { *env.subDisplayFile() << "Ending run of 'Gravity + Projectile motion' example at " << ctime(&timevalNow.tv_sec) @@ -252,6 +209,4 @@ void computeGravityAndTraveledDistance(const QUESO::FullEnvironment& env) { << ctime(&timevalNow.tv_sec) << std::endl; } - - return; } From e1a1a1da65d9b9520be5c41bbd5f6c04ceef6a3f Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 15 Dec 2014 16:42:41 -0600 Subject: [PATCH 14/99] Make likelihood subclass BaseScalaFunction --- examples/gravity/src/gravity_compute.h | 55 ++++--- examples/gravity/src/gravity_likelihood.C | 166 ++++++++++------------ examples/gravity/src/gravity_likelihood.h | 84 +++++------ 3 files changed, 143 insertions(+), 162 deletions(-) diff --git a/examples/gravity/src/gravity_compute.h b/examples/gravity/src/gravity_compute.h index cf50c0036..cae98e5ee 100644 --- a/examples/gravity/src/gravity_compute.h +++ b/examples/gravity/src/gravity_compute.h @@ -1,33 +1,32 @@ -/*------------------------------------------------------------------- - * - * Copyright (C) 2012 The PECOS Development Team - * - * Please see http://pecos.ices.utexas.edu for more information. - * - * This file is part of the QUESO Library (Quantification of Uncertainty - * for Estimation, Simulation and Optimization). - * - * QUESO is free software: you can redistribute it and/or modify - * it 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. - * - * QUESO 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. - * - * You should have received a copy of the GNU General Public License - * along with QUESO. If not, see . - * - *------------------------------------------------------------------- +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +/* + * Brief description of this file: * + * This is the header file for 'gravity_compute.C'. */ - /*------------------------------------------------------------------ - * Brief description of this file: - * - * This is the header file for 'gravity_compute.C'. - *-----------------------------------------------------------------*/ #ifndef EX_COMPUTE_H #define EX_COMPUTE_H diff --git a/examples/gravity/src/gravity_likelihood.C b/examples/gravity/src/gravity_likelihood.C index d7d26f099..9ce1a6267 100644 --- a/examples/gravity/src/gravity_likelihood.C +++ b/examples/gravity/src/gravity_likelihood.C @@ -1,102 +1,94 @@ -/*------------------------------------------------------------------- - * - * Copyright (C) 2012 The PECOS Development Team - * - * Please see http://pecos.ices.utexas.edu for more information. - * - * This file is part of the QUESO Library (Quantification of Uncertainty - * for Estimation, Simulation and Optimization). - * - * QUESO is free software: you can redistribute it and/or modify - * it 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. - * - * QUESO 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. - * - * You should have received a copy of the GNU General Public License - * along with QUESO. If not, see . - * - *------------------------------------------------------------------- - * - */ - /*------------------------------------------------------------------ - * This file contains the code for the user defined likelihood data - * class and the user defined likelihood routine. - *-----------------------------------------------------------------*/ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- -#include #include -#include -#include -// Construtor -likelihoodRoutine_Data::likelihoodRoutine_Data(const QUESO::BaseEnvironment& env) - : - m_heights(0), - m_times (0), - m_stdDevs(0), - m_env (&env) +#include +#include +#include +#include +#include +#include +#include + +#include + +template +Likelihood::Likelihood(const char * prefix, + const QUESO::VectorSet & domain) + : QUESO::BaseScalarFunction(prefix, domain), + m_heights(0), + m_times(0), + m_stdDevs(0) { // Data available in /inputData/data02.dat - double const heights[] = {10,20,30,40,50,60,70,80,90,100,110,120,130,140}; - double const times [] = {1.41,2.14,2.49,2.87,3.22,3.49,3.81,4.07,4.32,4.47, - 4.75,4.99,5.16,5.26}; - double const stdDevs[] = {0.020,0.120,0.020,0.010,0.030,0.010,0.030,0.030, - 0.030,0.050,0.010,0.040,0.010,0.09}; - - std::size_t const n = sizeof(heights)/sizeof(*heights); + double const heights[] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, + 120, 130, 140}; + + double const times [] = {1.41, 2.14, 2.49, 2.87, 3.22, 3.49, 3.81, 4.07, + 4.32, 4.47, 4.75, 4.99, 5.16, 5.26}; + + double const stdDevs[] = {0.020, 0.120, 0.020, 0.010, 0.030, 0.010, 0.030, + 0.030, 0.030, 0.050, 0.010, 0.040, 0.010, 0.09}; + + std::size_t const n = sizeof(heights) / sizeof(*heights); m_heights.assign(heights, heights + n); - m_times.assign (times, times + n); + m_times.assign(times, times + n); m_stdDevs.assign(stdDevs, stdDevs + n); } -// Destructor -likelihoodRoutine_Data::~likelihoodRoutine_Data() +template +Likelihood::~Likelihood() { + // Deconstruct here } -//------------------------------------------------------ -// The user defined likelihood routine -//------------------------------------------------------ -double likelihoodRoutine( - const QUESO::GslVector& paramValues, - const QUESO::GslVector* paramDirection, - const void* functionDataPtr, - QUESO::GslVector* gradVector, - QUESO::GslMatrix* hessianMatrix, - QUESO::GslVector* hessianEffect) +template +double +Likelihood::lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const { - const QUESO::BaseEnvironment& env = *(((likelihoodRoutine_Data*) functionDataPtr)->m_env); - - if (paramDirection && functionDataPtr && gradVector && hessianMatrix && hessianEffect) - { - // Just to eliminate INTEL compiler warnings + double g = domainVector[0]; + + double misfitValue = 0.0; + for (unsigned int i = 0; i < m_heights.size(); ++i) { + double modelTime = std::sqrt(2.0 * m_heights[i] / g); + double ratio = (modelTime - m_times[i]) / m_stdDevs[i]; + misfitValue += ratio * ratio; } - - env.subComm().Barrier(); - - // The user, at the application level, should have set - // the vector 'paramValues' to have size 1. - UQ_FATAL_TEST_MACRO(paramValues.sizeGlobal() != 1, - env.fullRank(), - "likelihoodRoutine()", - "paramValues vector does not have size 1"); - - // Compute likelihood - double g = paramValues[0]; - const std::vector& heights=((likelihoodRoutine_Data*) functionDataPtr)->m_heights; - const std::vector& times =((likelihoodRoutine_Data*) functionDataPtr)->m_times; - const std::vector& stdDevs=((likelihoodRoutine_Data*) functionDataPtr)->m_stdDevs; - - double misfitValue = 0.; - for (unsigned int i = 0; i < heights.size(); ++i) { - double modelTime = sqrt(2.0 * heights[i]/g); - double ratio = (modelTime - times[i])/stdDevs[i]; - misfitValue += ratio*ratio; - } - return (-0.5*misfitValue); + + return -0.5 * misfitValue; +} + +template +double +Likelihood::actualValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); } + +template class Likelihood; diff --git a/examples/gravity/src/gravity_likelihood.h b/examples/gravity/src/gravity_likelihood.h index 8a20b238f..1bf0454ab 100644 --- a/examples/gravity/src/gravity_likelihood.h +++ b/examples/gravity/src/gravity_likelihood.h @@ -1,58 +1,48 @@ -/*------------------------------------------------------------------- - * - * Copyright (C) 2012 The PECOS Development Team - * - * Please see http://pecos.ices.utexas.edu for more information. - * - * This file is part of the QUESO Library (Quantification of Uncertainty - * for Estimation, Simulation and Optimization). - * - * QUESO is free software: you can redistribute it and/or modify - * it 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. - * - * QUESO 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. - * - * You should have received a copy of the GNU General Public License - * along with QUESO. If not, see . - * - *------------------------------------------------------------------- - * - */ - /*------------------------------------------------------------------ - * Brief description of this file: - * - * This is the header file for gravity_likelihood.C. - *-----------------------------------------------------------------*/ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- -#ifndef __GRAVITY_LIKELIHOOD_H__ -#define __GRAVITY_LIKELIHOOD_H__ +#ifndef QUESO_EXAMPLE_GRAVITY_LIKELIHOOD_H +#define QUESO_EXAMPLE_GRAVITY_LIKELIHOOD_H +#include #include -struct likelihoodRoutine_Data // user defined class +template +class Likelihood : public QUESO::BaseScalarFunction { - likelihoodRoutine_Data(const QUESO::BaseEnvironment& env); - ~likelihoodRoutine_Data(); +public: + Likelihood(const char * prefix, const QUESO::VectorSet & domain); + virtual ~Likelihood(); + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; +private: std::vector m_heights; // heights std::vector m_times; // times - std::vector m_stdDevs; // account for uncertainties in - // time measurement: sigmas - - const QUESO::BaseEnvironment* m_env; + std::vector m_stdDevs; // uncertainties in time measurements }; -double likelihoodRoutine( // user defined routine - const QUESO::GslVector& paramValues, - const QUESO::GslVector* paramDirection, - const void* functionDataPtr, - QUESO::GslVector* gradVector, - QUESO::GslMatrix* hessianMatrix, - QUESO::GslVector* hessianEffect); - #endif From 266447ea1939923e25ab0c68a6781448654b4236 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 15 Dec 2014 16:43:15 -0600 Subject: [PATCH 15/99] Make qoi subclass BaseVectorFunction --- examples/gravity/src/gravity_qoi.C | 135 +++++++++++++---------------- examples/gravity/src/gravity_qoi.h | 89 ++++++++++--------- 2 files changed, 106 insertions(+), 118 deletions(-) diff --git a/examples/gravity/src/gravity_qoi.C b/examples/gravity/src/gravity_qoi.C index c96ed9423..c8792f396 100644 --- a/examples/gravity/src/gravity_qoi.C +++ b/examples/gravity/src/gravity_qoi.C @@ -1,85 +1,70 @@ -/*------------------------------------------------------------------------ - * - * Copyright (C) 2012 The PECOS Development Team - * - * Please see http://pecos.ices.utexas.edu for more information. - * - * This file is part of the QUESO Library (Quantification of Uncertainty - * for Estimation, Simulation and Optimization). - * - * QUESO is free software: you can redistribute it and/or modify - * it 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. - * - * QUESO 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. - * - * You should have received a copy of the GNU General Public License - * along with QUESO. If not, see . - * - *------------------------------------------------------------------------ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +/* + * Brief description of this file: * - */ - /*------------------------------------------------------------------ - * Brief description of this file: - * * This file contains the code for the user defined qoi routine. - *-----------------------------------------------------------------*/ + */ +#include +#include #include -#include -//------------------------------------------------------ -/// The actual (user-defined) qoi routine -//------------------------------------------------------ -void -qoiRoutine( - const QUESO::GslVector& paramValues, - const QUESO::GslVector* paramDirection, - const void* functionDataPtr, - QUESO::GslVector& qoiValues, - QUESO::DistArray* gradVectors, - QUESO::DistArray* hessianMatrices, - QUESO::DistArray* hessianEffects) +template +Qoi::Qoi(const char * prefix, + const QUESO::VectorSet & domainSet, + const QUESO::VectorSet & imageSet) + : QUESO::BaseVectorFunction(prefix, domainSet, imageSet), + m_angle(M_PI / 4.0), + m_initialVelocity(5.0), + m_initialHeight(0.0) { - const QUESO::BaseEnvironment& env = paramValues.env(); - - if (paramDirection && - gradVectors && - hessianEffects && - hessianMatrices) { - // Logic just to avoid warnings from INTEL compiler - } +} - // The user, at the application level, should have set - // the vector 'paramValues' to have size 1 and - // the vector 'qoiValues' to have size 1. - UQ_FATAL_TEST_MACRO(paramValues.sizeGlobal() != 1, - env.fullRank(), - "qoiRoutine()", - "paramValues vector does not have size 1"); +template +Qoi::~Qoi() +{ + // Deconstruct here +} - UQ_FATAL_TEST_MACRO(qoiValues.sizeGlobal() != 1, - env.fullRank(), - "qoiRoutine()", - "qoiValues vector does not have size 1"); - - // Compute qoi(s) - double g = paramValues[0]; // Sample of the RV 'gravity acceleration' - double distanceTraveled = 0.; - if (env.subRank() == 0) { - double velocity = ((qoiRoutine_Data *) functionDataPtr)->m_initialVelocity; - double heights = ((qoiRoutine_Data *) functionDataPtr)->m_initialHeight; - double alpha = ((qoiRoutine_Data *) functionDataPtr)->m_angle; - - double aux = velocity * sin(alpha); - distanceTraveled = (velocity * cos(alpha) / g) * ( aux + sqrt(pow(aux,2) + 2.*g*heights) ); - } +template +void +Qoi::compute(const P_V & domainVector, + const P_V * domainDirection, + Q_V & imageVector, QUESO::DistArray * gradVectors, + QUESO::DistArray * hessianMatrices, + QUESO::DistArray * hessianEffects) const +{ + double g = domainVector[0]; // Sample of the RV 'gravity acceleration' + double distanceTraveled = 0.0; + double aux = m_initialVelocity * std::sin(m_angle); + distanceTraveled = (m_initialVelocity * std::cos(m_angle) / g) * + (aux + std::sqrt(std::pow(aux, 2) + 2.0 * g * m_initialHeight)); - qoiValues[0] = distanceTraveled; - - return; + imageVector[0] = distanceTraveled; } + +template class Qoi; diff --git a/examples/gravity/src/gravity_qoi.h b/examples/gravity/src/gravity_qoi.h index 9b9f7bfdf..b0be2735d 100644 --- a/examples/gravity/src/gravity_qoi.h +++ b/examples/gravity/src/gravity_qoi.h @@ -1,56 +1,59 @@ -/*------------------------------------------------------------------------ - * - * Copyright (C) 2012 The PECOS Development Team - * - * Please see http://pecos.ices.utexas.edu for more information. - * - * This file is part of the QUESO Library (Quantification of Uncertainty - * for Estimation, Simulation and Optimization). - * - * QUESO is free software: you can redistribute it and/or modify - * it 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. - * - * QUESO 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. - * - * You should have received a copy of the GNU General Public License - * along with QUESO. If not, see . - * - *------------------------------------------------------------------------ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +/* + * Brief description of this file: * + * This is the header file from gravity_qoi.C. */ - /*------------------------------------------------------------------ - * Brief description of this file: - * - * This is the header file from gravity_qoi.C. - *-----------------------------------------------------------------*/ -#ifndef __GRAVITY_QOI_H__ -#define __GRAVITY_QOI_H__ +#ifndef QUESO_EXAMPLE_GRAVITY_QOI_H +#define QUESO_EXAMPLE_GRAVITY_QOI_H -#include +#include #include -struct -qoiRoutine_Data +template +class Qoi : public QUESO::BaseVectorFunction { +public: + Qoi(const char * prefix, const QUESO::VectorSet & domainSet, + const QUESO::VectorSet & imageSet); + virtual ~Qoi(); + virtual void compute(const P_V & domainVector, const P_V * domainDirection, + Q_V & imageVector, QUESO::DistArray * gradVectors, + QUESO::DistArray * hessianMatrices, + QUESO::DistArray * hessianEffects) const; + + void setAngle(double angle); + void setInitialVelocity(double velocity); + void setInitialHeight(double height); + +private: double m_angle; double m_initialVelocity; double m_initialHeight; }; -void -qoiRoutine( - const QUESO::GslVector& paramValues, - const QUESO::GslVector* paramDirection, - const void* functionDataPtr, - QUESO::GslVector& qoiValues, - QUESO::DistArray* gradVectors, - QUESO::DistArray* hessianMatrices, - QUESO::DistArray* hessianEffects); - #endif From a4515041af981a9d049f6c2377849f82bf518055 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 15 Dec 2014 16:43:48 -0600 Subject: [PATCH 16/99] Fix bug in template example --- examples/template_example/template_example.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/template_example/template_example.cpp b/examples/template_example/template_example.cpp index 0b61a7776..cc16c3487 100644 --- a/examples/template_example/template_example.cpp +++ b/examples/template_example/template_example.cpp @@ -12,7 +12,7 @@ class Likelihood : public QUESO::BaseScalarFunction public: Likelihood(const char * prefix, const QUESO::VectorSet & domain) - : QUESO::BaseScalarFunction(prefix, domain) + : QUESO::BaseScalarFunction(prefix, domain) { // Setup here } @@ -80,7 +80,7 @@ int main(int argc, char ** argv) { // Step 3 of 5: Set up the likelihood using the class above Likelihood lhood("llhd_", paramDomain); - + // Step 4 of 5: Instantiate the inverse problem QUESO::GenericVectorRV postRv("post_", paramSpace); @@ -94,17 +94,17 @@ int main(int argc, char ** argv) { // Initial condition of the chain paramInitials[0] = 0.0; paramInitials[1] = 0.0; - + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); - for (unsigned int i = 0; i < 2; i++) { + for (unsigned int i = 0; i < 1; i++) { // Might need to tweak this proposalCovMatrix(i, i) = 0.1; } - + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); MPI_Finalize(); - + return 0; } From a835c3f1309465413ca50facc601652c0c25d628 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 16 Dec 2014 15:21:21 -0600 Subject: [PATCH 17/99] Update licence --- LICENSE | 2 +- examples/bimodal/src/bimodal_compute.C | 2 +- examples/bimodal/src/bimodal_compute.h | 2 +- examples/bimodal/src/bimodal_likelihood.C | 2 +- examples/bimodal/src/bimodal_likelihood.h | 2 +- examples/bimodal/src/bimodal_main.C | 2 +- .../src/simple_sfp_example_compute.C | 2 +- .../src/simple_sfp_example_compute.h | 2 +- .../src/simple_sfp_example_main.C | 2 +- .../src/simple_sfp_example_qoi.C | 2 +- .../src/simple_sfp_example_qoi.h | 2 +- examples/simpleStatisticalInverseProblem/src/example_compute.C | 2 +- examples/simpleStatisticalInverseProblem/src/example_compute.h | 2 +- .../simpleStatisticalInverseProblem/src/example_likelihood.C | 2 +- .../simpleStatisticalInverseProblem/src/example_likelihood.h | 2 +- examples/simpleStatisticalInverseProblem/src/example_main.C | 2 +- .../src/exStatisticalInverseProblem1_likelihood.h | 2 +- src/basic/inc/ArrayOfSequences.h | 2 +- src/basic/inc/BoxSubset.h | 2 +- src/basic/inc/ConcatenationSubset.h | 2 +- src/basic/inc/ConstantScalarFunction.h | 2 +- src/basic/inc/ConstantVectorFunction.h | 2 +- src/basic/inc/DiscreteSubset.h | 2 +- src/basic/inc/GenericScalarFunction.h | 2 +- src/basic/inc/GenericVectorFunction.h | 2 +- src/basic/inc/InstantiateIntersection.h | 2 +- src/basic/inc/IntersectionSubset.h | 2 +- src/basic/inc/ScalarFunction.h | 2 +- src/basic/inc/ScalarFunctionSynchronizer.h | 2 +- src/basic/inc/ScalarSequence.h | 2 +- src/basic/inc/SequenceOfVectors.h | 2 +- src/basic/inc/SequenceStatisticalOptions.h | 2 +- src/basic/inc/VectorFunction.h | 2 +- src/basic/inc/VectorFunctionSynchronizer.h | 2 +- src/basic/inc/VectorSet.h | 2 +- src/basic/inc/VectorSpace.h | 2 +- src/basic/inc/VectorSubset.h | 2 +- src/basic/src/ArrayOfSequences.C | 2 +- src/basic/src/BoxSubset.C | 2 +- src/basic/src/ConcatenationSubset.C | 2 +- src/basic/src/ConstantScalarFunction.C | 2 +- src/basic/src/ConstantVectorFunction.C | 2 +- src/basic/src/DiscreteSubset.C | 2 +- src/basic/src/GenericScalarFunction.C | 2 +- src/basic/src/GenericVectorFunction.C | 2 +- src/basic/src/GslVectorSpace.C | 2 +- src/basic/src/InstantiateIntersection.C | 2 +- src/basic/src/IntersectionSubset.C | 2 +- src/basic/src/ScalarFunction.C | 2 +- src/basic/src/ScalarFunctionSynchronizer.C | 2 +- src/basic/src/ScalarSequence.C | 2 +- src/basic/src/SequenceOfVectors.C | 2 +- src/basic/src/SequenceStatisticalOptions.C | 2 +- src/basic/src/TeuchosVectorSpace.C | 2 +- src/basic/src/VectorFunction.C | 2 +- src/basic/src/VectorFunctionSynchronizer.C | 2 +- src/basic/src/VectorSet.C | 2 +- src/basic/src/VectorSpace.C | 2 +- src/basic/src/VectorSubset.C | 2 +- src/contrib/inc/all.h | 2 +- src/core/inc/BasicPdfsBase.h | 2 +- src/core/inc/BasicPdfsBoost.h | 2 +- src/core/inc/BasicPdfsGsl.h | 2 +- src/core/inc/Defines.h | 2 +- src/core/inc/DistArray.h | 2 +- src/core/inc/Environment.h | 2 +- src/core/inc/EnvironmentOptions.h | 2 +- src/core/inc/FunctionBase.h | 2 +- src/core/inc/FunctionOperatorBuilder.h | 2 +- src/core/inc/GslMatrix.h | 2 +- src/core/inc/GslOptimizer.h | 2 +- src/core/inc/GslVector.h | 2 +- src/core/inc/InfiniteDimensionalGaussian.h | 2 +- src/core/inc/InfiniteDimensionalMCMCSampler.h | 2 +- src/core/inc/InfiniteDimensionalMeasureBase.h | 2 +- src/core/inc/LibMeshFunction.h | 2 +- src/core/inc/LibMeshNegativeLaplacianOperator.h | 2 +- src/core/inc/LibMeshOperatorBase.h | 2 +- src/core/inc/Map.h | 2 +- src/core/inc/Matrix.h | 2 +- src/core/inc/MpiComm.h | 2 +- src/core/inc/OperatorBase.h | 2 +- src/core/inc/Optimizer.h | 2 +- src/core/inc/OptimizerMonitor.h | 2 +- src/core/inc/RngBase.h | 2 +- src/core/inc/RngBoost.h | 2 +- src/core/inc/RngGsl.h | 2 +- src/core/inc/TeuchosMatrix.h | 2 +- src/core/inc/TeuchosVector.h | 2 +- src/core/inc/Vector.h | 2 +- src/core/inc/asserts.h | 2 +- src/core/inc/exceptions.h | 2 +- src/core/inc/queso.h.in | 2 +- src/core/src/BasicPdfsBase.C | 2 +- src/core/src/BasicPdfsBoost.C | 2 +- src/core/src/BasicPdfsGsl.C | 2 +- src/core/src/Defines.C | 2 +- src/core/src/DistArray.C | 2 +- src/core/src/Environment.C | 2 +- src/core/src/EnvironmentOptions.C | 2 +- src/core/src/FunctionBase.C | 2 +- src/core/src/FunctionOperatorBuilder.C | 2 +- src/core/src/GslMatrix.C | 2 +- src/core/src/GslOptimizer.C | 2 +- src/core/src/GslVector.C | 2 +- src/core/src/InfiniteDimensionalGaussian.C | 2 +- src/core/src/InfiniteDimensionalMeasureBase.C | 2 +- src/core/src/LibMeshFunction.C | 2 +- src/core/src/LibMeshNegativeLaplacianOperator.C | 2 +- src/core/src/LibMeshOperatorBase.C | 2 +- src/core/src/Map.C | 2 +- src/core/src/Matrix.C | 2 +- src/core/src/MpiComm.C | 2 +- src/core/src/OperatorBase.C | 2 +- src/core/src/Optimizer.C | 2 +- src/core/src/OptimizerMonitor.C | 2 +- src/core/src/RngBase.C | 2 +- src/core/src/RngBoost.C | 2 +- src/core/src/RngGsl.C | 2 +- src/core/src/TeuchosMatrix.C | 2 +- src/core/src/TeuchosVector.C | 2 +- src/core/src/Vector.C | 2 +- src/core/src/version.C | 2 +- src/gp/inc/ExperimentModel.h | 2 +- src/gp/inc/ExperimentModelOptions.h | 2 +- src/gp/inc/ExperimentStorage.h | 2 +- src/gp/inc/GPMSA.h | 2 +- src/gp/inc/GcmExperimentInfo.h | 2 +- src/gp/inc/GcmJointInfo.h | 2 +- src/gp/inc/GcmJointTildeInfo.h | 2 +- src/gp/inc/GcmSimulationInfo.h | 2 +- src/gp/inc/GcmSimulationTildeInfo.h | 2 +- src/gp/inc/GcmTotalInfo.h | 2 +- src/gp/inc/GcmZInfo.h | 2 +- src/gp/inc/GcmZTildeInfo.h | 2 +- src/gp/inc/GpmsaComputerModel.h | 2 +- src/gp/inc/GpmsaComputerModelOptions.h | 2 +- src/gp/inc/SimulationModel.h | 2 +- src/gp/inc/SimulationModelOptions.h | 2 +- src/gp/inc/SimulationStorage.h | 2 +- src/gp/src/ExperimentModel.C | 2 +- src/gp/src/ExperimentModelOptions.C | 2 +- src/gp/src/ExperimentStorage.C | 2 +- src/gp/src/GPMSA.C | 2 +- src/gp/src/GPMSAOptions.C | 2 +- src/gp/src/GcmExperimentInfo.C | 2 +- src/gp/src/GcmJointInfo.C | 2 +- src/gp/src/GcmJointTildeInfo.C | 2 +- src/gp/src/GcmSimulationInfo.C | 2 +- src/gp/src/GcmSimulationTildeInfo.C | 2 +- src/gp/src/GcmTotalInfo.C | 2 +- src/gp/src/GcmZInfo.C | 2 +- src/gp/src/GcmZTildeInfo.C | 2 +- src/gp/src/GpmsaComputerModel.C | 2 +- src/gp/src/GpmsaComputerModelOptions.C | 2 +- src/gp/src/SimulationModel.C | 2 +- src/gp/src/SimulationModelOptions.C | 2 +- src/gp/src/SimulationStorage.C | 2 +- src/misc/inc/1D1DFunction.h | 2 +- src/misc/inc/1DQuadrature.h | 2 +- src/misc/inc/2dArrayOfStuff.h | 2 +- src/misc/inc/ArrayOfOneDGrids.h | 2 +- src/misc/inc/ArrayOfOneDTables.h | 2 +- src/misc/inc/AsciiTable.h | 2 +- src/misc/inc/CovCond.h | 2 +- src/misc/inc/Fft.h | 2 +- src/misc/inc/Miscellaneous.h | 2 +- src/misc/inc/OneDGrid.h | 2 +- src/misc/inc/StdOneDGrid.h | 2 +- src/misc/inc/UniformOneDGrid.h | 2 +- src/misc/src/1D1DFunction.C | 2 +- src/misc/src/1DQuadrature.C | 2 +- src/misc/src/2dArrayOfStuff.C | 2 +- src/misc/src/ArrayOfOneDGrids.C | 2 +- src/misc/src/ArrayOfOneDTables.C | 2 +- src/misc/src/AsciiTable.C | 2 +- src/misc/src/ComplexFft.C | 2 +- src/misc/src/CovCond.C | 2 +- src/misc/src/Fft.C | 2 +- src/misc/src/GslAsciiTable.C | 2 +- src/misc/src/Miscellaneous.C | 2 +- src/misc/src/OneDGrid.C | 2 +- src/misc/src/RealFft.C | 2 +- src/misc/src/StdOneDGrid.C | 2 +- src/misc/src/UniformOneDGrid.C | 2 +- src/stats/inc/BayesianJointPdf.h | 2 +- src/stats/inc/BetaJointPdf.h | 2 +- src/stats/inc/BetaVectorRV.h | 2 +- src/stats/inc/BetaVectorRealizer.h | 2 +- src/stats/inc/ConcatenatedJointPdf.h | 2 +- src/stats/inc/ConcatenatedVectorRV.h | 2 +- src/stats/inc/ConcatenatedVectorRealizer.h | 2 +- src/stats/inc/ExponentialMatrixCovarianceFunction.h | 2 +- src/stats/inc/ExponentialScalarCovarianceFunction.h | 2 +- src/stats/inc/FiniteDistribution.h | 2 +- src/stats/inc/GammaJointPdf.h | 2 +- src/stats/inc/GammaVectorRV.h | 2 +- src/stats/inc/GammaVectorRealizer.h | 2 +- src/stats/inc/GaussianJointPdf.h | 2 +- src/stats/inc/GaussianVectorCdf.h | 2 +- src/stats/inc/GaussianVectorMdf.h | 2 +- src/stats/inc/GaussianVectorRV.h | 2 +- src/stats/inc/GaussianVectorRealizer.h | 2 +- src/stats/inc/GenericJointPdf.h | 2 +- src/stats/inc/GenericMatrixCovarianceFunction.h | 2 +- src/stats/inc/GenericScalarCovarianceFunction.h | 2 +- src/stats/inc/GenericVectorCdf.h | 2 +- src/stats/inc/GenericVectorMdf.h | 2 +- src/stats/inc/GenericVectorRV.h | 2 +- src/stats/inc/GenericVectorRealizer.h | 2 +- src/stats/inc/HessianCovMatricesTKGroup.h | 2 +- src/stats/inc/InfoTheory.h | 2 +- src/stats/inc/InvLogitGaussianJointPdf.h | 2 +- src/stats/inc/InvLogitGaussianVectorRV.h | 2 +- src/stats/inc/InvLogitGaussianVectorRealizer.h | 2 +- src/stats/inc/InverseGammaJointPdf.h | 2 +- src/stats/inc/InverseGammaVectorRV.h | 2 +- src/stats/inc/InverseGammaVectorRealizer.h | 2 +- src/stats/inc/JeffreysJointPdf.h | 2 +- src/stats/inc/JeffreysVectorRV.h | 2 +- src/stats/inc/JeffreysVectorRealizer.h | 2 +- src/stats/inc/JointPdf.h | 2 +- src/stats/inc/LogNormalJointPdf.h | 2 +- src/stats/inc/LogNormalVectorRV.h | 2 +- src/stats/inc/LogNormalVectorRealizer.h | 2 +- src/stats/inc/MLSampling.h | 2 +- src/stats/inc/MLSamplingLevelOptions.h | 2 +- src/stats/inc/MLSamplingOptions.h | 2 +- src/stats/inc/MarkovChainPositionData.h | 2 +- src/stats/inc/MatrixCovarianceFunction.h | 2 +- src/stats/inc/MetropolisHastingsSG.h | 2 +- src/stats/inc/MetropolisHastingsSGOptions.h | 2 +- src/stats/inc/ModelValidation.h | 2 +- src/stats/inc/MonteCarloSG.h | 2 +- src/stats/inc/MonteCarloSGOptions.h | 2 +- src/stats/inc/PoweredJointPdf.h | 2 +- src/stats/inc/SampledScalarCdf.h | 2 +- src/stats/inc/SampledVectorCdf.h | 2 +- src/stats/inc/SampledVectorMdf.h | 2 +- src/stats/inc/ScalarCdf.h | 2 +- src/stats/inc/ScalarCovarianceFunction.h | 2 +- src/stats/inc/ScalarGaussianRandomField.h | 2 +- src/stats/inc/ScaledCovMatrixTKGroup.h | 2 +- src/stats/inc/SequentialVectorRealizer.h | 2 +- src/stats/inc/StatisticalForwardProblem.h | 2 +- src/stats/inc/StatisticalForwardProblemOptions.h | 2 +- src/stats/inc/StatisticalInverseProblem.h | 2 +- src/stats/inc/StatisticalInverseProblemOptions.h | 2 +- src/stats/inc/StdScalarCdf.h | 2 +- src/stats/inc/TKGroup.h | 2 +- src/stats/inc/TransformedScaledCovMatrixTKGroup.h | 2 +- src/stats/inc/UniformJointPdf.h | 2 +- src/stats/inc/UniformVectorRV.h | 2 +- src/stats/inc/UniformVectorRealizer.h | 2 +- src/stats/inc/ValidationCycle.h | 2 +- src/stats/inc/VectorCdf.h | 2 +- src/stats/inc/VectorGaussianRandomField.h | 2 +- src/stats/inc/VectorMdf.h | 2 +- src/stats/inc/VectorRV.h | 2 +- src/stats/inc/VectorRealizer.h | 2 +- src/stats/inc/WignerJointPdf.h | 2 +- src/stats/inc/WignerVectorRV.h | 2 +- src/stats/inc/WignerVectorRealizer.h | 2 +- src/stats/src/BayesianJointPdf.C | 2 +- src/stats/src/BetaJointPdf.C | 2 +- src/stats/src/BetaVectorRV.C | 2 +- src/stats/src/BetaVectorRealizer.C | 2 +- src/stats/src/ConcatenatedJointPdf.C | 2 +- src/stats/src/ConcatenatedVectorRV.C | 2 +- src/stats/src/ConcatenatedVectorRealizer.C | 2 +- src/stats/src/ExponentialMatrixCovarianceFunction.C | 2 +- src/stats/src/ExponentialScalarCovarianceFunction.C | 2 +- src/stats/src/FiniteDistribution.C | 2 +- src/stats/src/GammaJointPdf.C | 2 +- src/stats/src/GammaVectorRV.C | 2 +- src/stats/src/GammaVectorRealizer.C | 2 +- src/stats/src/GaussianJointPdf.C | 2 +- src/stats/src/GaussianVectorCdf.C | 2 +- src/stats/src/GaussianVectorMdf.C | 2 +- src/stats/src/GaussianVectorRV.C | 2 +- src/stats/src/GaussianVectorRealizer.C | 2 +- src/stats/src/GenericJointPdf.C | 2 +- src/stats/src/GenericMatrixCovarianceFunction.C | 2 +- src/stats/src/GenericScalarCovarianceFunction.C | 2 +- src/stats/src/GenericVectorCdf.C | 2 +- src/stats/src/GenericVectorMdf.C | 2 +- src/stats/src/GenericVectorRV.C | 2 +- src/stats/src/GenericVectorRealizer.C | 2 +- src/stats/src/HessianCovMatricesTKGroup.C | 2 +- src/stats/src/InfoTheory.C | 2 +- src/stats/src/InvLogitGaussianJointPdf.C | 2 +- src/stats/src/InvLogitGaussianVectorRV.C | 2 +- src/stats/src/InvLogitGaussianVectorRealizer.C | 2 +- src/stats/src/InverseGammaJointPdf.C | 2 +- src/stats/src/InverseGammaVectorRV.C | 2 +- src/stats/src/InverseGammaVectorRealizer.C | 2 +- src/stats/src/JeffreysJointPdf.C | 2 +- src/stats/src/JeffreysVectorRV.C | 2 +- src/stats/src/JeffreysVectorRealizer.C | 2 +- src/stats/src/JointPdf.C | 2 +- src/stats/src/LogNormalJointPdf.C | 2 +- src/stats/src/LogNormalVectorRV.C | 2 +- src/stats/src/LogNormalVectorRealizer.C | 2 +- src/stats/src/MLSampling.C | 2 +- src/stats/src/MLSamplingLevelOptions.C | 2 +- src/stats/src/MLSamplingOptions.C | 2 +- src/stats/src/MarkovChainPositionData.C | 2 +- src/stats/src/MatrixCovarianceFunction.C | 2 +- src/stats/src/MetropolisHastingsSG.C | 2 +- src/stats/src/MetropolisHastingsSGOptions.C | 2 +- src/stats/src/ModelValidation.C | 2 +- src/stats/src/MonteCarloSG.C | 2 +- src/stats/src/MonteCarloSGOptions.C | 2 +- src/stats/src/PoweredJointPdf.C | 2 +- src/stats/src/SampledScalarCdf.C | 2 +- src/stats/src/SampledVectorCdf.C | 2 +- src/stats/src/SampledVectorMdf.C | 2 +- src/stats/src/ScalarCdf.C | 2 +- src/stats/src/ScalarCovarianceFunction.C | 2 +- src/stats/src/ScalarGaussianRandomField.C | 2 +- src/stats/src/ScaledCovMatrixTKGroup.C | 2 +- src/stats/src/SequentialVectorRealizer.C | 2 +- src/stats/src/StatisticalForwardProblem.C | 2 +- src/stats/src/StatisticalForwardProblemOptions.C | 2 +- src/stats/src/StatisticalInverseProblem.C | 2 +- src/stats/src/StatisticalInverseProblemOptions.C | 2 +- src/stats/src/StdScalarCdf.C | 2 +- src/stats/src/TKGroup.C | 2 +- src/stats/src/TransformedScaledCovMatrixTKGroup.C | 2 +- src/stats/src/UniformJointPdf.C | 2 +- src/stats/src/UniformVectorRV.C | 2 +- src/stats/src/UniformVectorRealizer.C | 2 +- src/stats/src/ValidationCycle.C | 2 +- src/stats/src/VectorCdf.C | 2 +- src/stats/src/VectorGaussianRandomField.C | 2 +- src/stats/src/VectorMdf.C | 2 +- src/stats/src/VectorRV.C | 2 +- src/stats/src/VectorRealizer.C | 2 +- src/stats/src/WignerJointPdf.C | 2 +- src/stats/src/WignerVectorRV.C | 2 +- src/stats/src/WignerVectorRealizer.C | 2 +- test/gsl_tests/get_min_max_vec.C | 2 +- test/gsl_tests/get_min_max_vec.h | 2 +- test/gsl_tests/get_set_row_column.C | 2 +- test/gsl_tests/get_set_row_column.h | 2 +- test/gsl_tests/inverse_power_method.C | 2 +- test/gsl_tests/inverse_power_method.h | 2 +- test/gsl_tests/multiple_rhs_matrix_solve.C | 2 +- test/gsl_tests/multiple_rhs_matrix_solve.h | 2 +- test/gsl_tests/power_method.C | 2 +- test/gsl_tests/power_method.h | 2 +- test/t01_valid_cycle/TgaValidationCycle_appl.h | 2 +- test/t01_valid_cycle/TgaValidationCycle_gsl.C | 2 +- test/t01_valid_cycle/TgaValidationCycle_likelihood.h | 2 +- test/t01_valid_cycle/TgaValidationCycle_qoi.h | 2 +- test/t02_sip_sfp/example_compute.C | 2 +- test/t02_sip_sfp/example_compute.h | 2 +- test/t02_sip_sfp/example_likelihood.C | 2 +- test/t02_sip_sfp/example_likelihood.h | 2 +- test/t02_sip_sfp/example_main.C | 2 +- test/t02_sip_sfp/example_qoi.C | 2 +- test/t02_sip_sfp/example_qoi.h | 2 +- test/t03_sequence/example_compute.C | 2 +- test/t03_sequence/example_compute.h | 2 +- test/t03_sequence/example_main.C | 2 +- test/t04_bimodal/example_compute.C | 2 +- test/t04_bimodal/example_compute.h | 2 +- test/t04_bimodal/example_likelihood.C | 2 +- test/t04_bimodal/example_likelihood.h | 2 +- test/t04_bimodal/example_main.C | 2 +- 370 files changed, 370 insertions(+), 370 deletions(-) diff --git a/LICENSE b/LICENSE index 6703e267c..00846c2cb 100644 --- a/LICENSE +++ b/LICENSE @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/bimodal/src/bimodal_compute.C b/examples/bimodal/src/bimodal_compute.C index e9678ae34..422b0e12d 100644 --- a/examples/bimodal/src/bimodal_compute.C +++ b/examples/bimodal/src/bimodal_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/bimodal/src/bimodal_compute.h b/examples/bimodal/src/bimodal_compute.h index fcd66a87b..dec479377 100644 --- a/examples/bimodal/src/bimodal_compute.h +++ b/examples/bimodal/src/bimodal_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/bimodal/src/bimodal_likelihood.C b/examples/bimodal/src/bimodal_likelihood.C index ff10fd490..3693351c3 100644 --- a/examples/bimodal/src/bimodal_likelihood.C +++ b/examples/bimodal/src/bimodal_likelihood.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/bimodal/src/bimodal_likelihood.h b/examples/bimodal/src/bimodal_likelihood.h index 4bd14f483..a6adf7052 100644 --- a/examples/bimodal/src/bimodal_likelihood.h +++ b/examples/bimodal/src/bimodal_likelihood.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/bimodal/src/bimodal_main.C b/examples/bimodal/src/bimodal_main.C index 042be6817..ba71f7035 100644 --- a/examples/bimodal/src/bimodal_main.C +++ b/examples/bimodal/src/bimodal_main.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C index 4af7faeb5..739a703d8 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.h b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.h index 51936b166..481db38d3 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.h +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_main.C b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_main.C index 9903fc9d9..285b3b87b 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_main.C +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_main.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C index 484f21c49..6412a9187 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.h b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.h index 5edd9377b..d74e9326a 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.h +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalInverseProblem/src/example_compute.C b/examples/simpleStatisticalInverseProblem/src/example_compute.C index 8bdbc868e..e66ba5a1b 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_compute.C +++ b/examples/simpleStatisticalInverseProblem/src/example_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalInverseProblem/src/example_compute.h b/examples/simpleStatisticalInverseProblem/src/example_compute.h index fcd66a87b..dec479377 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_compute.h +++ b/examples/simpleStatisticalInverseProblem/src/example_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalInverseProblem/src/example_likelihood.C b/examples/simpleStatisticalInverseProblem/src/example_likelihood.C index b657cf04b..0f1e34360 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_likelihood.C +++ b/examples/simpleStatisticalInverseProblem/src/example_likelihood.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalInverseProblem/src/example_likelihood.h b/examples/simpleStatisticalInverseProblem/src/example_likelihood.h index 4bd14f483..a6adf7052 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_likelihood.h +++ b/examples/simpleStatisticalInverseProblem/src/example_likelihood.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/simpleStatisticalInverseProblem/src/example_main.C b/examples/simpleStatisticalInverseProblem/src/example_main.C index 379fcc10f..6640b53b1 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_main.C +++ b/examples/simpleStatisticalInverseProblem/src/example_main.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_likelihood.h b/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_likelihood.h index e7a04b167..baee716f5 100644 --- a/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_likelihood.h +++ b/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_likelihood.h @@ -5,7 +5,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ArrayOfSequences.h b/src/basic/inc/ArrayOfSequences.h index 23ce5ee32..d881c07ad 100644 --- a/src/basic/inc/ArrayOfSequences.h +++ b/src/basic/inc/ArrayOfSequences.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/BoxSubset.h b/src/basic/inc/BoxSubset.h index cb9378101..9678182d7 100644 --- a/src/basic/inc/BoxSubset.h +++ b/src/basic/inc/BoxSubset.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ConcatenationSubset.h b/src/basic/inc/ConcatenationSubset.h index 95afe6299..ace38fb49 100644 --- a/src/basic/inc/ConcatenationSubset.h +++ b/src/basic/inc/ConcatenationSubset.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ConstantScalarFunction.h b/src/basic/inc/ConstantScalarFunction.h index 56e6ec472..03eec5827 100644 --- a/src/basic/inc/ConstantScalarFunction.h +++ b/src/basic/inc/ConstantScalarFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ConstantVectorFunction.h b/src/basic/inc/ConstantVectorFunction.h index 5553b2002..820719d4d 100644 --- a/src/basic/inc/ConstantVectorFunction.h +++ b/src/basic/inc/ConstantVectorFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/DiscreteSubset.h b/src/basic/inc/DiscreteSubset.h index 98700f3ba..de9351a68 100644 --- a/src/basic/inc/DiscreteSubset.h +++ b/src/basic/inc/DiscreteSubset.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/GenericScalarFunction.h b/src/basic/inc/GenericScalarFunction.h index baa2a2a40..9f3bd0c23 100644 --- a/src/basic/inc/GenericScalarFunction.h +++ b/src/basic/inc/GenericScalarFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/GenericVectorFunction.h b/src/basic/inc/GenericVectorFunction.h index 61fe5f98e..4019a0d54 100644 --- a/src/basic/inc/GenericVectorFunction.h +++ b/src/basic/inc/GenericVectorFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/InstantiateIntersection.h b/src/basic/inc/InstantiateIntersection.h index 694b41559..20153dc6d 100644 --- a/src/basic/inc/InstantiateIntersection.h +++ b/src/basic/inc/InstantiateIntersection.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/IntersectionSubset.h b/src/basic/inc/IntersectionSubset.h index 629a86ad7..e9e104df6 100644 --- a/src/basic/inc/IntersectionSubset.h +++ b/src/basic/inc/IntersectionSubset.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ScalarFunction.h b/src/basic/inc/ScalarFunction.h index f90608fa9..b33b01a32 100644 --- a/src/basic/inc/ScalarFunction.h +++ b/src/basic/inc/ScalarFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ScalarFunctionSynchronizer.h b/src/basic/inc/ScalarFunctionSynchronizer.h index 34c3c7d7f..17d8c442f 100644 --- a/src/basic/inc/ScalarFunctionSynchronizer.h +++ b/src/basic/inc/ScalarFunctionSynchronizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/ScalarSequence.h b/src/basic/inc/ScalarSequence.h index 3e873a8f0..781a9ddac 100644 --- a/src/basic/inc/ScalarSequence.h +++ b/src/basic/inc/ScalarSequence.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/SequenceOfVectors.h b/src/basic/inc/SequenceOfVectors.h index b9dc26d41..d55edfdab 100644 --- a/src/basic/inc/SequenceOfVectors.h +++ b/src/basic/inc/SequenceOfVectors.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/SequenceStatisticalOptions.h b/src/basic/inc/SequenceStatisticalOptions.h index 509c71036..e91e06f8d 100644 --- a/src/basic/inc/SequenceStatisticalOptions.h +++ b/src/basic/inc/SequenceStatisticalOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/VectorFunction.h b/src/basic/inc/VectorFunction.h index be2b28611..09f022032 100644 --- a/src/basic/inc/VectorFunction.h +++ b/src/basic/inc/VectorFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/VectorFunctionSynchronizer.h b/src/basic/inc/VectorFunctionSynchronizer.h index 4655d36c1..455f2dfad 100644 --- a/src/basic/inc/VectorFunctionSynchronizer.h +++ b/src/basic/inc/VectorFunctionSynchronizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/VectorSet.h b/src/basic/inc/VectorSet.h index 29e501c8a..f801cbea6 100644 --- a/src/basic/inc/VectorSet.h +++ b/src/basic/inc/VectorSet.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/VectorSpace.h b/src/basic/inc/VectorSpace.h index 2e651a877..f69217500 100644 --- a/src/basic/inc/VectorSpace.h +++ b/src/basic/inc/VectorSpace.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/inc/VectorSubset.h b/src/basic/inc/VectorSubset.h index 8e4caf8b1..cfb2b4e2e 100644 --- a/src/basic/inc/VectorSubset.h +++ b/src/basic/inc/VectorSubset.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ArrayOfSequences.C b/src/basic/src/ArrayOfSequences.C index 1d1d31704..be22a757b 100644 --- a/src/basic/src/ArrayOfSequences.C +++ b/src/basic/src/ArrayOfSequences.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/BoxSubset.C b/src/basic/src/BoxSubset.C index 753772e2c..0a5addcd2 100644 --- a/src/basic/src/BoxSubset.C +++ b/src/basic/src/BoxSubset.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ConcatenationSubset.C b/src/basic/src/ConcatenationSubset.C index f41cdcccb..beffe244c 100644 --- a/src/basic/src/ConcatenationSubset.C +++ b/src/basic/src/ConcatenationSubset.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ConstantScalarFunction.C b/src/basic/src/ConstantScalarFunction.C index c190bbeae..000dedc02 100644 --- a/src/basic/src/ConstantScalarFunction.C +++ b/src/basic/src/ConstantScalarFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ConstantVectorFunction.C b/src/basic/src/ConstantVectorFunction.C index 5cf7af1d0..727e53d00 100644 --- a/src/basic/src/ConstantVectorFunction.C +++ b/src/basic/src/ConstantVectorFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/DiscreteSubset.C b/src/basic/src/DiscreteSubset.C index cb68df0ae..7b899361a 100644 --- a/src/basic/src/DiscreteSubset.C +++ b/src/basic/src/DiscreteSubset.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/GenericScalarFunction.C b/src/basic/src/GenericScalarFunction.C index 9c6680015..4293729cc 100644 --- a/src/basic/src/GenericScalarFunction.C +++ b/src/basic/src/GenericScalarFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/GenericVectorFunction.C b/src/basic/src/GenericVectorFunction.C index b700227fd..d1655fb8b 100644 --- a/src/basic/src/GenericVectorFunction.C +++ b/src/basic/src/GenericVectorFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/GslVectorSpace.C b/src/basic/src/GslVectorSpace.C index 997382688..b589079bd 100644 --- a/src/basic/src/GslVectorSpace.C +++ b/src/basic/src/GslVectorSpace.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/InstantiateIntersection.C b/src/basic/src/InstantiateIntersection.C index 0a885c280..3e8429c0f 100644 --- a/src/basic/src/InstantiateIntersection.C +++ b/src/basic/src/InstantiateIntersection.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/IntersectionSubset.C b/src/basic/src/IntersectionSubset.C index 9fa51c26d..2ba8acfc8 100644 --- a/src/basic/src/IntersectionSubset.C +++ b/src/basic/src/IntersectionSubset.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ScalarFunction.C b/src/basic/src/ScalarFunction.C index 065e184b0..5b9ae459c 100644 --- a/src/basic/src/ScalarFunction.C +++ b/src/basic/src/ScalarFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ScalarFunctionSynchronizer.C b/src/basic/src/ScalarFunctionSynchronizer.C index 66511a52e..b28c41fb3 100644 --- a/src/basic/src/ScalarFunctionSynchronizer.C +++ b/src/basic/src/ScalarFunctionSynchronizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/ScalarSequence.C b/src/basic/src/ScalarSequence.C index 8dee18a4a..a2ee431db 100644 --- a/src/basic/src/ScalarSequence.C +++ b/src/basic/src/ScalarSequence.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/SequenceOfVectors.C b/src/basic/src/SequenceOfVectors.C index 9e2faae45..124df7747 100644 --- a/src/basic/src/SequenceOfVectors.C +++ b/src/basic/src/SequenceOfVectors.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/SequenceStatisticalOptions.C b/src/basic/src/SequenceStatisticalOptions.C index ffaa1221c..6971b994b 100644 --- a/src/basic/src/SequenceStatisticalOptions.C +++ b/src/basic/src/SequenceStatisticalOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/TeuchosVectorSpace.C b/src/basic/src/TeuchosVectorSpace.C index 6372027c6..a2dc04e25 100644 --- a/src/basic/src/TeuchosVectorSpace.C +++ b/src/basic/src/TeuchosVectorSpace.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/VectorFunction.C b/src/basic/src/VectorFunction.C index 3f8c29784..fa0f2e7ce 100644 --- a/src/basic/src/VectorFunction.C +++ b/src/basic/src/VectorFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/VectorFunctionSynchronizer.C b/src/basic/src/VectorFunctionSynchronizer.C index 8ebb01079..1e021d73b 100644 --- a/src/basic/src/VectorFunctionSynchronizer.C +++ b/src/basic/src/VectorFunctionSynchronizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/VectorSet.C b/src/basic/src/VectorSet.C index c840af2fc..374dcf0c0 100644 --- a/src/basic/src/VectorSet.C +++ b/src/basic/src/VectorSet.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/VectorSpace.C b/src/basic/src/VectorSpace.C index d60ef59ba..66330bfc7 100644 --- a/src/basic/src/VectorSpace.C +++ b/src/basic/src/VectorSpace.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/basic/src/VectorSubset.C b/src/basic/src/VectorSubset.C index e9a5d2557..7b265043b 100644 --- a/src/basic/src/VectorSubset.C +++ b/src/basic/src/VectorSubset.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/contrib/inc/all.h b/src/contrib/inc/all.h index 59f789efe..13c15d3c8 100644 --- a/src/contrib/inc/all.h +++ b/src/contrib/inc/all.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/BasicPdfsBase.h b/src/core/inc/BasicPdfsBase.h index bde6e448f..2ac1edf9d 100644 --- a/src/core/inc/BasicPdfsBase.h +++ b/src/core/inc/BasicPdfsBase.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/BasicPdfsBoost.h b/src/core/inc/BasicPdfsBoost.h index 96f566ef6..da5d6373e 100644 --- a/src/core/inc/BasicPdfsBoost.h +++ b/src/core/inc/BasicPdfsBoost.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/BasicPdfsGsl.h b/src/core/inc/BasicPdfsGsl.h index 5b03873c2..7c72b1c8d 100644 --- a/src/core/inc/BasicPdfsGsl.h +++ b/src/core/inc/BasicPdfsGsl.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/Defines.h b/src/core/inc/Defines.h index 75fe86848..48908402b 100644 --- a/src/core/inc/Defines.h +++ b/src/core/inc/Defines.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/DistArray.h b/src/core/inc/DistArray.h index e1c724f37..45158e2d7 100644 --- a/src/core/inc/DistArray.h +++ b/src/core/inc/DistArray.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/Environment.h b/src/core/inc/Environment.h index 79515af11..e0384c7f3 100644 --- a/src/core/inc/Environment.h +++ b/src/core/inc/Environment.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/EnvironmentOptions.h b/src/core/inc/EnvironmentOptions.h index 5f542c992..1fd77792d 100644 --- a/src/core/inc/EnvironmentOptions.h +++ b/src/core/inc/EnvironmentOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/FunctionBase.h b/src/core/inc/FunctionBase.h index 7956d3e2d..cde299d1d 100644 --- a/src/core/inc/FunctionBase.h +++ b/src/core/inc/FunctionBase.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/FunctionOperatorBuilder.h b/src/core/inc/FunctionOperatorBuilder.h index 46c113f6b..af8d07103 100644 --- a/src/core/inc/FunctionOperatorBuilder.h +++ b/src/core/inc/FunctionOperatorBuilder.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/GslMatrix.h b/src/core/inc/GslMatrix.h index f39b7842c..0967f7646 100644 --- a/src/core/inc/GslMatrix.h +++ b/src/core/inc/GslMatrix.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/GslOptimizer.h b/src/core/inc/GslOptimizer.h index a63f4fab6..7ff59e391 100644 --- a/src/core/inc/GslOptimizer.h +++ b/src/core/inc/GslOptimizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/GslVector.h b/src/core/inc/GslVector.h index c57a3757a..8c569fa3d 100644 --- a/src/core/inc/GslVector.h +++ b/src/core/inc/GslVector.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/InfiniteDimensionalGaussian.h b/src/core/inc/InfiniteDimensionalGaussian.h index c98fe7ffb..50267d10f 100644 --- a/src/core/inc/InfiniteDimensionalGaussian.h +++ b/src/core/inc/InfiniteDimensionalGaussian.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/InfiniteDimensionalMCMCSampler.h b/src/core/inc/InfiniteDimensionalMCMCSampler.h index 4c43d19e3..9085c9321 100644 --- a/src/core/inc/InfiniteDimensionalMCMCSampler.h +++ b/src/core/inc/InfiniteDimensionalMCMCSampler.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/InfiniteDimensionalMeasureBase.h b/src/core/inc/InfiniteDimensionalMeasureBase.h index 787e57731..1321e50a4 100644 --- a/src/core/inc/InfiniteDimensionalMeasureBase.h +++ b/src/core/inc/InfiniteDimensionalMeasureBase.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/LibMeshFunction.h b/src/core/inc/LibMeshFunction.h index 0351309ad..c37fcb93f 100644 --- a/src/core/inc/LibMeshFunction.h +++ b/src/core/inc/LibMeshFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/LibMeshNegativeLaplacianOperator.h b/src/core/inc/LibMeshNegativeLaplacianOperator.h index b0c1d8e61..3631c946a 100644 --- a/src/core/inc/LibMeshNegativeLaplacianOperator.h +++ b/src/core/inc/LibMeshNegativeLaplacianOperator.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/LibMeshOperatorBase.h b/src/core/inc/LibMeshOperatorBase.h index 891724726..5fe444494 100644 --- a/src/core/inc/LibMeshOperatorBase.h +++ b/src/core/inc/LibMeshOperatorBase.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/Map.h b/src/core/inc/Map.h index f80bcb833..54e05a1cd 100644 --- a/src/core/inc/Map.h +++ b/src/core/inc/Map.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/Matrix.h b/src/core/inc/Matrix.h index e0c8556d7..77045e9aa 100644 --- a/src/core/inc/Matrix.h +++ b/src/core/inc/Matrix.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/MpiComm.h b/src/core/inc/MpiComm.h index 0c007aaa6..a5da4610e 100644 --- a/src/core/inc/MpiComm.h +++ b/src/core/inc/MpiComm.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/OperatorBase.h b/src/core/inc/OperatorBase.h index 35df0984b..fef39627f 100644 --- a/src/core/inc/OperatorBase.h +++ b/src/core/inc/OperatorBase.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/Optimizer.h b/src/core/inc/Optimizer.h index 530571f53..ea29a7eb9 100644 --- a/src/core/inc/Optimizer.h +++ b/src/core/inc/Optimizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/OptimizerMonitor.h b/src/core/inc/OptimizerMonitor.h index dd63d7865..fa89341c4 100644 --- a/src/core/inc/OptimizerMonitor.h +++ b/src/core/inc/OptimizerMonitor.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/RngBase.h b/src/core/inc/RngBase.h index 17940152d..4eba7260c 100644 --- a/src/core/inc/RngBase.h +++ b/src/core/inc/RngBase.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/RngBoost.h b/src/core/inc/RngBoost.h index 0d297bb89..7ee5a722b 100644 --- a/src/core/inc/RngBoost.h +++ b/src/core/inc/RngBoost.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/RngGsl.h b/src/core/inc/RngGsl.h index 00662b07a..d4d3953d9 100644 --- a/src/core/inc/RngGsl.h +++ b/src/core/inc/RngGsl.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/TeuchosMatrix.h b/src/core/inc/TeuchosMatrix.h index 9bc4397a5..8fefa596f 100644 --- a/src/core/inc/TeuchosMatrix.h +++ b/src/core/inc/TeuchosMatrix.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/TeuchosVector.h b/src/core/inc/TeuchosVector.h index 4c83e2888..be5ccab03 100644 --- a/src/core/inc/TeuchosVector.h +++ b/src/core/inc/TeuchosVector.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/Vector.h b/src/core/inc/Vector.h index ff8174271..7cb781868 100644 --- a/src/core/inc/Vector.h +++ b/src/core/inc/Vector.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/asserts.h b/src/core/inc/asserts.h index 0d49fd510..1e6dd101f 100644 --- a/src/core/inc/asserts.h +++ b/src/core/inc/asserts.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/exceptions.h b/src/core/inc/exceptions.h index 96f76eba5..b9f15c632 100644 --- a/src/core/inc/exceptions.h +++ b/src/core/inc/exceptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/inc/queso.h.in b/src/core/inc/queso.h.in index b97d19834..adc189578 100644 --- a/src/core/inc/queso.h.in +++ b/src/core/inc/queso.h.in @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/BasicPdfsBase.C b/src/core/src/BasicPdfsBase.C index e0b56d544..66e2e0809 100644 --- a/src/core/src/BasicPdfsBase.C +++ b/src/core/src/BasicPdfsBase.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/BasicPdfsBoost.C b/src/core/src/BasicPdfsBoost.C index fbd267616..dff6edf83 100644 --- a/src/core/src/BasicPdfsBoost.C +++ b/src/core/src/BasicPdfsBoost.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/BasicPdfsGsl.C b/src/core/src/BasicPdfsGsl.C index 21d479fb0..d47f60716 100644 --- a/src/core/src/BasicPdfsGsl.C +++ b/src/core/src/BasicPdfsGsl.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/Defines.C b/src/core/src/Defines.C index 525852193..d15e96512 100644 --- a/src/core/src/Defines.C +++ b/src/core/src/Defines.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/DistArray.C b/src/core/src/DistArray.C index e3906427f..d9f0eb67b 100644 --- a/src/core/src/DistArray.C +++ b/src/core/src/DistArray.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/Environment.C b/src/core/src/Environment.C index d11747146..bcb944c0e 100644 --- a/src/core/src/Environment.C +++ b/src/core/src/Environment.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/EnvironmentOptions.C b/src/core/src/EnvironmentOptions.C index eb1da1c1e..9b4a01159 100644 --- a/src/core/src/EnvironmentOptions.C +++ b/src/core/src/EnvironmentOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/FunctionBase.C b/src/core/src/FunctionBase.C index 77ffe9fe0..ab8797382 100644 --- a/src/core/src/FunctionBase.C +++ b/src/core/src/FunctionBase.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/FunctionOperatorBuilder.C b/src/core/src/FunctionOperatorBuilder.C index fef720d99..27bcd40bf 100644 --- a/src/core/src/FunctionOperatorBuilder.C +++ b/src/core/src/FunctionOperatorBuilder.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/GslMatrix.C b/src/core/src/GslMatrix.C index 00fe9a330..37cec723d 100644 --- a/src/core/src/GslMatrix.C +++ b/src/core/src/GslMatrix.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/GslOptimizer.C b/src/core/src/GslOptimizer.C index 2c6c8c238..76deef1c7 100644 --- a/src/core/src/GslOptimizer.C +++ b/src/core/src/GslOptimizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/GslVector.C b/src/core/src/GslVector.C index b82e6fce3..0337a628e 100644 --- a/src/core/src/GslVector.C +++ b/src/core/src/GslVector.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/InfiniteDimensionalGaussian.C b/src/core/src/InfiniteDimensionalGaussian.C index f76e3127a..3a3e46539 100644 --- a/src/core/src/InfiniteDimensionalGaussian.C +++ b/src/core/src/InfiniteDimensionalGaussian.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/InfiniteDimensionalMeasureBase.C b/src/core/src/InfiniteDimensionalMeasureBase.C index 3c9837d3d..5afbe8443 100644 --- a/src/core/src/InfiniteDimensionalMeasureBase.C +++ b/src/core/src/InfiniteDimensionalMeasureBase.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/LibMeshFunction.C b/src/core/src/LibMeshFunction.C index 7c953df4b..3cf05b0b0 100644 --- a/src/core/src/LibMeshFunction.C +++ b/src/core/src/LibMeshFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/LibMeshNegativeLaplacianOperator.C b/src/core/src/LibMeshNegativeLaplacianOperator.C index afd6b5ce6..999509c8c 100644 --- a/src/core/src/LibMeshNegativeLaplacianOperator.C +++ b/src/core/src/LibMeshNegativeLaplacianOperator.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/LibMeshOperatorBase.C b/src/core/src/LibMeshOperatorBase.C index 8db7993a6..f3b1a69b4 100644 --- a/src/core/src/LibMeshOperatorBase.C +++ b/src/core/src/LibMeshOperatorBase.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/Map.C b/src/core/src/Map.C index 224ac7471..67210e644 100644 --- a/src/core/src/Map.C +++ b/src/core/src/Map.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/Matrix.C b/src/core/src/Matrix.C index 570acd994..4b751f301 100644 --- a/src/core/src/Matrix.C +++ b/src/core/src/Matrix.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/MpiComm.C b/src/core/src/MpiComm.C index 84c5d4200..bcbdc2a39 100644 --- a/src/core/src/MpiComm.C +++ b/src/core/src/MpiComm.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/OperatorBase.C b/src/core/src/OperatorBase.C index 6a7938686..0eb7113fe 100644 --- a/src/core/src/OperatorBase.C +++ b/src/core/src/OperatorBase.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/Optimizer.C b/src/core/src/Optimizer.C index 7047832c4..076ab0866 100644 --- a/src/core/src/Optimizer.C +++ b/src/core/src/Optimizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/OptimizerMonitor.C b/src/core/src/OptimizerMonitor.C index 6ac2b1bf1..79ac003df 100644 --- a/src/core/src/OptimizerMonitor.C +++ b/src/core/src/OptimizerMonitor.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/RngBase.C b/src/core/src/RngBase.C index 3fe2bec0d..e413831a3 100644 --- a/src/core/src/RngBase.C +++ b/src/core/src/RngBase.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/RngBoost.C b/src/core/src/RngBoost.C index 8c74ce5ba..dbe479d50 100644 --- a/src/core/src/RngBoost.C +++ b/src/core/src/RngBoost.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/RngGsl.C b/src/core/src/RngGsl.C index a1527522a..e36124ce3 100644 --- a/src/core/src/RngGsl.C +++ b/src/core/src/RngGsl.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/TeuchosMatrix.C b/src/core/src/TeuchosMatrix.C index ffa8008f5..feba92876 100644 --- a/src/core/src/TeuchosMatrix.C +++ b/src/core/src/TeuchosMatrix.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/TeuchosVector.C b/src/core/src/TeuchosVector.C index 3bdd0640f..62dcc6284 100644 --- a/src/core/src/TeuchosVector.C +++ b/src/core/src/TeuchosVector.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/Vector.C b/src/core/src/Vector.C index 0f6afa013..6b9483f9d 100644 --- a/src/core/src/Vector.C +++ b/src/core/src/Vector.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/core/src/version.C b/src/core/src/version.C index 585c8ff2b..9d7ddaa78 100644 --- a/src/core/src/version.C +++ b/src/core/src/version.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/ExperimentModel.h b/src/gp/inc/ExperimentModel.h index 6387b32cd..25611113f 100644 --- a/src/gp/inc/ExperimentModel.h +++ b/src/gp/inc/ExperimentModel.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/ExperimentModelOptions.h b/src/gp/inc/ExperimentModelOptions.h index 552531b3c..7e998e176 100644 --- a/src/gp/inc/ExperimentModelOptions.h +++ b/src/gp/inc/ExperimentModelOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/ExperimentStorage.h b/src/gp/inc/ExperimentStorage.h index 2a15439f0..e14faec6f 100644 --- a/src/gp/inc/ExperimentStorage.h +++ b/src/gp/inc/ExperimentStorage.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GPMSA.h b/src/gp/inc/GPMSA.h index 51ec0057e..f16695dd5 100644 --- a/src/gp/inc/GPMSA.h +++ b/src/gp/inc/GPMSA.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmExperimentInfo.h b/src/gp/inc/GcmExperimentInfo.h index bcf1cbde5..3e9f3e6c6 100644 --- a/src/gp/inc/GcmExperimentInfo.h +++ b/src/gp/inc/GcmExperimentInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmJointInfo.h b/src/gp/inc/GcmJointInfo.h index fb6d1b69a..df16d876c 100644 --- a/src/gp/inc/GcmJointInfo.h +++ b/src/gp/inc/GcmJointInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmJointTildeInfo.h b/src/gp/inc/GcmJointTildeInfo.h index 1772d2e32..9073ab57c 100644 --- a/src/gp/inc/GcmJointTildeInfo.h +++ b/src/gp/inc/GcmJointTildeInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmSimulationInfo.h b/src/gp/inc/GcmSimulationInfo.h index 1c25cd268..59fc7213c 100644 --- a/src/gp/inc/GcmSimulationInfo.h +++ b/src/gp/inc/GcmSimulationInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmSimulationTildeInfo.h b/src/gp/inc/GcmSimulationTildeInfo.h index ed89614c4..b8515715d 100644 --- a/src/gp/inc/GcmSimulationTildeInfo.h +++ b/src/gp/inc/GcmSimulationTildeInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmTotalInfo.h b/src/gp/inc/GcmTotalInfo.h index e3ef39165..9f4b650ee 100644 --- a/src/gp/inc/GcmTotalInfo.h +++ b/src/gp/inc/GcmTotalInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmZInfo.h b/src/gp/inc/GcmZInfo.h index 8b0983e4a..ce35d8491 100644 --- a/src/gp/inc/GcmZInfo.h +++ b/src/gp/inc/GcmZInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GcmZTildeInfo.h b/src/gp/inc/GcmZTildeInfo.h index 37111290f..0c9ae9dd9 100644 --- a/src/gp/inc/GcmZTildeInfo.h +++ b/src/gp/inc/GcmZTildeInfo.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GpmsaComputerModel.h b/src/gp/inc/GpmsaComputerModel.h index 0f7b1adf3..78247e306 100644 --- a/src/gp/inc/GpmsaComputerModel.h +++ b/src/gp/inc/GpmsaComputerModel.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/GpmsaComputerModelOptions.h b/src/gp/inc/GpmsaComputerModelOptions.h index b1a618087..35dff80a2 100644 --- a/src/gp/inc/GpmsaComputerModelOptions.h +++ b/src/gp/inc/GpmsaComputerModelOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/SimulationModel.h b/src/gp/inc/SimulationModel.h index 10d02b065..e7095d025 100644 --- a/src/gp/inc/SimulationModel.h +++ b/src/gp/inc/SimulationModel.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/SimulationModelOptions.h b/src/gp/inc/SimulationModelOptions.h index 63d885d93..4ec28094d 100644 --- a/src/gp/inc/SimulationModelOptions.h +++ b/src/gp/inc/SimulationModelOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/inc/SimulationStorage.h b/src/gp/inc/SimulationStorage.h index b5acc271d..9623d09c6 100644 --- a/src/gp/inc/SimulationStorage.h +++ b/src/gp/inc/SimulationStorage.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/ExperimentModel.C b/src/gp/src/ExperimentModel.C index eab2b5c00..81486cb17 100644 --- a/src/gp/src/ExperimentModel.C +++ b/src/gp/src/ExperimentModel.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/ExperimentModelOptions.C b/src/gp/src/ExperimentModelOptions.C index 27cc23fac..75514a0a3 100644 --- a/src/gp/src/ExperimentModelOptions.C +++ b/src/gp/src/ExperimentModelOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/ExperimentStorage.C b/src/gp/src/ExperimentStorage.C index e43f274cc..eb207adf9 100644 --- a/src/gp/src/ExperimentStorage.C +++ b/src/gp/src/ExperimentStorage.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GPMSA.C b/src/gp/src/GPMSA.C index da445355f..6f813ffa5 100644 --- a/src/gp/src/GPMSA.C +++ b/src/gp/src/GPMSA.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GPMSAOptions.C b/src/gp/src/GPMSAOptions.C index 9d54d5517..81a2041d9 100644 --- a/src/gp/src/GPMSAOptions.C +++ b/src/gp/src/GPMSAOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmExperimentInfo.C b/src/gp/src/GcmExperimentInfo.C index ca9f51d9d..490456ab9 100644 --- a/src/gp/src/GcmExperimentInfo.C +++ b/src/gp/src/GcmExperimentInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmJointInfo.C b/src/gp/src/GcmJointInfo.C index ed1690764..18d8cf693 100644 --- a/src/gp/src/GcmJointInfo.C +++ b/src/gp/src/GcmJointInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmJointTildeInfo.C b/src/gp/src/GcmJointTildeInfo.C index 4cc59222a..dbc13a9c0 100644 --- a/src/gp/src/GcmJointTildeInfo.C +++ b/src/gp/src/GcmJointTildeInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmSimulationInfo.C b/src/gp/src/GcmSimulationInfo.C index add75516f..ce266789e 100644 --- a/src/gp/src/GcmSimulationInfo.C +++ b/src/gp/src/GcmSimulationInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmSimulationTildeInfo.C b/src/gp/src/GcmSimulationTildeInfo.C index c4dc83178..de47c1a2d 100644 --- a/src/gp/src/GcmSimulationTildeInfo.C +++ b/src/gp/src/GcmSimulationTildeInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmTotalInfo.C b/src/gp/src/GcmTotalInfo.C index d68181684..398655ade 100644 --- a/src/gp/src/GcmTotalInfo.C +++ b/src/gp/src/GcmTotalInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmZInfo.C b/src/gp/src/GcmZInfo.C index 0751ea778..72c5c4e36 100644 --- a/src/gp/src/GcmZInfo.C +++ b/src/gp/src/GcmZInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GcmZTildeInfo.C b/src/gp/src/GcmZTildeInfo.C index 496def222..0a771bc7f 100644 --- a/src/gp/src/GcmZTildeInfo.C +++ b/src/gp/src/GcmZTildeInfo.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GpmsaComputerModel.C b/src/gp/src/GpmsaComputerModel.C index 10d290880..ca459841f 100644 --- a/src/gp/src/GpmsaComputerModel.C +++ b/src/gp/src/GpmsaComputerModel.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/GpmsaComputerModelOptions.C b/src/gp/src/GpmsaComputerModelOptions.C index 0127e5c3f..57ddf2224 100644 --- a/src/gp/src/GpmsaComputerModelOptions.C +++ b/src/gp/src/GpmsaComputerModelOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/SimulationModel.C b/src/gp/src/SimulationModel.C index 30ecfcb4f..630b68f95 100644 --- a/src/gp/src/SimulationModel.C +++ b/src/gp/src/SimulationModel.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/SimulationModelOptions.C b/src/gp/src/SimulationModelOptions.C index 762c8f5f5..a8854def5 100644 --- a/src/gp/src/SimulationModelOptions.C +++ b/src/gp/src/SimulationModelOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/gp/src/SimulationStorage.C b/src/gp/src/SimulationStorage.C index 4b89f552c..f6b806411 100644 --- a/src/gp/src/SimulationStorage.C +++ b/src/gp/src/SimulationStorage.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/1D1DFunction.h b/src/misc/inc/1D1DFunction.h index e1e14347b..65c1dc96e 100644 --- a/src/misc/inc/1D1DFunction.h +++ b/src/misc/inc/1D1DFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/1DQuadrature.h b/src/misc/inc/1DQuadrature.h index 9706099f5..733b68928 100644 --- a/src/misc/inc/1DQuadrature.h +++ b/src/misc/inc/1DQuadrature.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/2dArrayOfStuff.h b/src/misc/inc/2dArrayOfStuff.h index 0779c8ca7..1ca3c4372 100644 --- a/src/misc/inc/2dArrayOfStuff.h +++ b/src/misc/inc/2dArrayOfStuff.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/ArrayOfOneDGrids.h b/src/misc/inc/ArrayOfOneDGrids.h index bf50b046b..b69e32990 100644 --- a/src/misc/inc/ArrayOfOneDGrids.h +++ b/src/misc/inc/ArrayOfOneDGrids.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/ArrayOfOneDTables.h b/src/misc/inc/ArrayOfOneDTables.h index 9026f045a..881145adb 100644 --- a/src/misc/inc/ArrayOfOneDTables.h +++ b/src/misc/inc/ArrayOfOneDTables.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/AsciiTable.h b/src/misc/inc/AsciiTable.h index c48c846cf..e1ac7c3e4 100644 --- a/src/misc/inc/AsciiTable.h +++ b/src/misc/inc/AsciiTable.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/CovCond.h b/src/misc/inc/CovCond.h index 1d3da78a5..2e4a1cea7 100644 --- a/src/misc/inc/CovCond.h +++ b/src/misc/inc/CovCond.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/Fft.h b/src/misc/inc/Fft.h index c5f59357a..3b88ce4f3 100644 --- a/src/misc/inc/Fft.h +++ b/src/misc/inc/Fft.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/Miscellaneous.h b/src/misc/inc/Miscellaneous.h index f2bd8b8d2..328779c06 100644 --- a/src/misc/inc/Miscellaneous.h +++ b/src/misc/inc/Miscellaneous.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/OneDGrid.h b/src/misc/inc/OneDGrid.h index c7d518305..0ef927429 100644 --- a/src/misc/inc/OneDGrid.h +++ b/src/misc/inc/OneDGrid.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/StdOneDGrid.h b/src/misc/inc/StdOneDGrid.h index 046589cfa..d30c607e0 100644 --- a/src/misc/inc/StdOneDGrid.h +++ b/src/misc/inc/StdOneDGrid.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/inc/UniformOneDGrid.h b/src/misc/inc/UniformOneDGrid.h index aa0e0cd9a..9b731d17e 100644 --- a/src/misc/inc/UniformOneDGrid.h +++ b/src/misc/inc/UniformOneDGrid.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/1D1DFunction.C b/src/misc/src/1D1DFunction.C index b74ead17e..134ca8849 100644 --- a/src/misc/src/1D1DFunction.C +++ b/src/misc/src/1D1DFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/1DQuadrature.C b/src/misc/src/1DQuadrature.C index 3b9290c62..0e4bd95b7 100644 --- a/src/misc/src/1DQuadrature.C +++ b/src/misc/src/1DQuadrature.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/2dArrayOfStuff.C b/src/misc/src/2dArrayOfStuff.C index 63bb04c97..ac7932973 100644 --- a/src/misc/src/2dArrayOfStuff.C +++ b/src/misc/src/2dArrayOfStuff.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/ArrayOfOneDGrids.C b/src/misc/src/ArrayOfOneDGrids.C index 1e8356b72..08abfdc00 100644 --- a/src/misc/src/ArrayOfOneDGrids.C +++ b/src/misc/src/ArrayOfOneDGrids.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/ArrayOfOneDTables.C b/src/misc/src/ArrayOfOneDTables.C index 543c892fb..3e97ef63d 100644 --- a/src/misc/src/ArrayOfOneDTables.C +++ b/src/misc/src/ArrayOfOneDTables.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/AsciiTable.C b/src/misc/src/AsciiTable.C index dec8b235a..631f92367 100644 --- a/src/misc/src/AsciiTable.C +++ b/src/misc/src/AsciiTable.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/ComplexFft.C b/src/misc/src/ComplexFft.C index d3d5d626b..27230d0e4 100644 --- a/src/misc/src/ComplexFft.C +++ b/src/misc/src/ComplexFft.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/CovCond.C b/src/misc/src/CovCond.C index f410fbf2d..f8677ac37 100644 --- a/src/misc/src/CovCond.C +++ b/src/misc/src/CovCond.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/Fft.C b/src/misc/src/Fft.C index 45d16f65f..56376935c 100644 --- a/src/misc/src/Fft.C +++ b/src/misc/src/Fft.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/GslAsciiTable.C b/src/misc/src/GslAsciiTable.C index a7f31b91c..f5ee1cdbc 100644 --- a/src/misc/src/GslAsciiTable.C +++ b/src/misc/src/GslAsciiTable.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/Miscellaneous.C b/src/misc/src/Miscellaneous.C index 1370cec09..bd12024e4 100644 --- a/src/misc/src/Miscellaneous.C +++ b/src/misc/src/Miscellaneous.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/OneDGrid.C b/src/misc/src/OneDGrid.C index f5aa7480b..3eac2a9ba 100644 --- a/src/misc/src/OneDGrid.C +++ b/src/misc/src/OneDGrid.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/RealFft.C b/src/misc/src/RealFft.C index 136ac3563..4915261fb 100644 --- a/src/misc/src/RealFft.C +++ b/src/misc/src/RealFft.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/StdOneDGrid.C b/src/misc/src/StdOneDGrid.C index ef34aeecd..62abebeb9 100644 --- a/src/misc/src/StdOneDGrid.C +++ b/src/misc/src/StdOneDGrid.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/misc/src/UniformOneDGrid.C b/src/misc/src/UniformOneDGrid.C index c5282b103..34cfd28cc 100644 --- a/src/misc/src/UniformOneDGrid.C +++ b/src/misc/src/UniformOneDGrid.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/BayesianJointPdf.h b/src/stats/inc/BayesianJointPdf.h index 55d4d5417..17d92c585 100644 --- a/src/stats/inc/BayesianJointPdf.h +++ b/src/stats/inc/BayesianJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/BetaJointPdf.h b/src/stats/inc/BetaJointPdf.h index b562148de..fa30ca23a 100644 --- a/src/stats/inc/BetaJointPdf.h +++ b/src/stats/inc/BetaJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/BetaVectorRV.h b/src/stats/inc/BetaVectorRV.h index cb928fb28..0c3163b54 100644 --- a/src/stats/inc/BetaVectorRV.h +++ b/src/stats/inc/BetaVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/BetaVectorRealizer.h b/src/stats/inc/BetaVectorRealizer.h index 9189970c7..30777f3f9 100644 --- a/src/stats/inc/BetaVectorRealizer.h +++ b/src/stats/inc/BetaVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ConcatenatedJointPdf.h b/src/stats/inc/ConcatenatedJointPdf.h index 017c41915..86b12d269 100644 --- a/src/stats/inc/ConcatenatedJointPdf.h +++ b/src/stats/inc/ConcatenatedJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ConcatenatedVectorRV.h b/src/stats/inc/ConcatenatedVectorRV.h index 2c83f0862..a82c8dc10 100644 --- a/src/stats/inc/ConcatenatedVectorRV.h +++ b/src/stats/inc/ConcatenatedVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ConcatenatedVectorRealizer.h b/src/stats/inc/ConcatenatedVectorRealizer.h index 1bc5b28f8..9b291bf98 100644 --- a/src/stats/inc/ConcatenatedVectorRealizer.h +++ b/src/stats/inc/ConcatenatedVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ExponentialMatrixCovarianceFunction.h b/src/stats/inc/ExponentialMatrixCovarianceFunction.h index 36e13df31..8a5b6eed1 100644 --- a/src/stats/inc/ExponentialMatrixCovarianceFunction.h +++ b/src/stats/inc/ExponentialMatrixCovarianceFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ExponentialScalarCovarianceFunction.h b/src/stats/inc/ExponentialScalarCovarianceFunction.h index 83c46f606..617d5fd02 100644 --- a/src/stats/inc/ExponentialScalarCovarianceFunction.h +++ b/src/stats/inc/ExponentialScalarCovarianceFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/FiniteDistribution.h b/src/stats/inc/FiniteDistribution.h index 25b05f625..df706bb28 100644 --- a/src/stats/inc/FiniteDistribution.h +++ b/src/stats/inc/FiniteDistribution.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GammaJointPdf.h b/src/stats/inc/GammaJointPdf.h index 2715fafa6..8a97960c3 100644 --- a/src/stats/inc/GammaJointPdf.h +++ b/src/stats/inc/GammaJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GammaVectorRV.h b/src/stats/inc/GammaVectorRV.h index 18529a629..107579b01 100644 --- a/src/stats/inc/GammaVectorRV.h +++ b/src/stats/inc/GammaVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GammaVectorRealizer.h b/src/stats/inc/GammaVectorRealizer.h index dc2e558a5..eae20f95e 100644 --- a/src/stats/inc/GammaVectorRealizer.h +++ b/src/stats/inc/GammaVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GaussianJointPdf.h b/src/stats/inc/GaussianJointPdf.h index 536e33ae1..a38ed59c2 100644 --- a/src/stats/inc/GaussianJointPdf.h +++ b/src/stats/inc/GaussianJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GaussianVectorCdf.h b/src/stats/inc/GaussianVectorCdf.h index 350b411ae..ac05d19c6 100644 --- a/src/stats/inc/GaussianVectorCdf.h +++ b/src/stats/inc/GaussianVectorCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GaussianVectorMdf.h b/src/stats/inc/GaussianVectorMdf.h index 3bd6910f3..d3d40b00b 100644 --- a/src/stats/inc/GaussianVectorMdf.h +++ b/src/stats/inc/GaussianVectorMdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GaussianVectorRV.h b/src/stats/inc/GaussianVectorRV.h index 7cd201729..ddff5edb8 100644 --- a/src/stats/inc/GaussianVectorRV.h +++ b/src/stats/inc/GaussianVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GaussianVectorRealizer.h b/src/stats/inc/GaussianVectorRealizer.h index 1fc6db08f..5f1b8c60c 100644 --- a/src/stats/inc/GaussianVectorRealizer.h +++ b/src/stats/inc/GaussianVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericJointPdf.h b/src/stats/inc/GenericJointPdf.h index f1dc22375..649bbb812 100644 --- a/src/stats/inc/GenericJointPdf.h +++ b/src/stats/inc/GenericJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericMatrixCovarianceFunction.h b/src/stats/inc/GenericMatrixCovarianceFunction.h index 23a05e287..33771c723 100644 --- a/src/stats/inc/GenericMatrixCovarianceFunction.h +++ b/src/stats/inc/GenericMatrixCovarianceFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericScalarCovarianceFunction.h b/src/stats/inc/GenericScalarCovarianceFunction.h index 4e769dbe0..c3034ca04 100644 --- a/src/stats/inc/GenericScalarCovarianceFunction.h +++ b/src/stats/inc/GenericScalarCovarianceFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericVectorCdf.h b/src/stats/inc/GenericVectorCdf.h index 37279338f..f4c8b5750 100644 --- a/src/stats/inc/GenericVectorCdf.h +++ b/src/stats/inc/GenericVectorCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericVectorMdf.h b/src/stats/inc/GenericVectorMdf.h index 39573af3f..7314b31e3 100644 --- a/src/stats/inc/GenericVectorMdf.h +++ b/src/stats/inc/GenericVectorMdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericVectorRV.h b/src/stats/inc/GenericVectorRV.h index b0dd675cb..12844289a 100644 --- a/src/stats/inc/GenericVectorRV.h +++ b/src/stats/inc/GenericVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/GenericVectorRealizer.h b/src/stats/inc/GenericVectorRealizer.h index 743e07116..5f3489025 100644 --- a/src/stats/inc/GenericVectorRealizer.h +++ b/src/stats/inc/GenericVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/HessianCovMatricesTKGroup.h b/src/stats/inc/HessianCovMatricesTKGroup.h index b85cbd1bd..2a7d46463 100644 --- a/src/stats/inc/HessianCovMatricesTKGroup.h +++ b/src/stats/inc/HessianCovMatricesTKGroup.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InfoTheory.h b/src/stats/inc/InfoTheory.h index d7c1b548f..cfc752c10 100644 --- a/src/stats/inc/InfoTheory.h +++ b/src/stats/inc/InfoTheory.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InvLogitGaussianJointPdf.h b/src/stats/inc/InvLogitGaussianJointPdf.h index 13655704e..098bddc4e 100644 --- a/src/stats/inc/InvLogitGaussianJointPdf.h +++ b/src/stats/inc/InvLogitGaussianJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InvLogitGaussianVectorRV.h b/src/stats/inc/InvLogitGaussianVectorRV.h index 5dfa125e7..5b0d4a934 100644 --- a/src/stats/inc/InvLogitGaussianVectorRV.h +++ b/src/stats/inc/InvLogitGaussianVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InvLogitGaussianVectorRealizer.h b/src/stats/inc/InvLogitGaussianVectorRealizer.h index dd436eebc..b7eba0f89 100644 --- a/src/stats/inc/InvLogitGaussianVectorRealizer.h +++ b/src/stats/inc/InvLogitGaussianVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InverseGammaJointPdf.h b/src/stats/inc/InverseGammaJointPdf.h index 66356c7e9..be17e6bf9 100644 --- a/src/stats/inc/InverseGammaJointPdf.h +++ b/src/stats/inc/InverseGammaJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InverseGammaVectorRV.h b/src/stats/inc/InverseGammaVectorRV.h index f01c0ae3d..9cb2be130 100644 --- a/src/stats/inc/InverseGammaVectorRV.h +++ b/src/stats/inc/InverseGammaVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/InverseGammaVectorRealizer.h b/src/stats/inc/InverseGammaVectorRealizer.h index 8a6a6fd11..ba92b5068 100644 --- a/src/stats/inc/InverseGammaVectorRealizer.h +++ b/src/stats/inc/InverseGammaVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/JeffreysJointPdf.h b/src/stats/inc/JeffreysJointPdf.h index 2f69aced1..8daddee36 100644 --- a/src/stats/inc/JeffreysJointPdf.h +++ b/src/stats/inc/JeffreysJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/JeffreysVectorRV.h b/src/stats/inc/JeffreysVectorRV.h index 364854ba7..894d2e7ed 100644 --- a/src/stats/inc/JeffreysVectorRV.h +++ b/src/stats/inc/JeffreysVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/JeffreysVectorRealizer.h b/src/stats/inc/JeffreysVectorRealizer.h index 72e7b34a5..f5b97dfbe 100644 --- a/src/stats/inc/JeffreysVectorRealizer.h +++ b/src/stats/inc/JeffreysVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/JointPdf.h b/src/stats/inc/JointPdf.h index 91a2966b1..1926d0d9c 100644 --- a/src/stats/inc/JointPdf.h +++ b/src/stats/inc/JointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/LogNormalJointPdf.h b/src/stats/inc/LogNormalJointPdf.h index 12b31d356..1c31526c2 100644 --- a/src/stats/inc/LogNormalJointPdf.h +++ b/src/stats/inc/LogNormalJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/LogNormalVectorRV.h b/src/stats/inc/LogNormalVectorRV.h index 60cfac9ff..4bd7c5e22 100644 --- a/src/stats/inc/LogNormalVectorRV.h +++ b/src/stats/inc/LogNormalVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/LogNormalVectorRealizer.h b/src/stats/inc/LogNormalVectorRealizer.h index 0769bc614..9c7171399 100644 --- a/src/stats/inc/LogNormalVectorRealizer.h +++ b/src/stats/inc/LogNormalVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MLSampling.h b/src/stats/inc/MLSampling.h index c5e3a33ea..4e2e01c5b 100644 --- a/src/stats/inc/MLSampling.h +++ b/src/stats/inc/MLSampling.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MLSamplingLevelOptions.h b/src/stats/inc/MLSamplingLevelOptions.h index e7665c9b9..d4a606432 100644 --- a/src/stats/inc/MLSamplingLevelOptions.h +++ b/src/stats/inc/MLSamplingLevelOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MLSamplingOptions.h b/src/stats/inc/MLSamplingOptions.h index 8f7984099..877653c83 100644 --- a/src/stats/inc/MLSamplingOptions.h +++ b/src/stats/inc/MLSamplingOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MarkovChainPositionData.h b/src/stats/inc/MarkovChainPositionData.h index 38cb82b89..52fbe6f2f 100644 --- a/src/stats/inc/MarkovChainPositionData.h +++ b/src/stats/inc/MarkovChainPositionData.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MatrixCovarianceFunction.h b/src/stats/inc/MatrixCovarianceFunction.h index e369bac23..c57bf5a36 100644 --- a/src/stats/inc/MatrixCovarianceFunction.h +++ b/src/stats/inc/MatrixCovarianceFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MetropolisHastingsSG.h b/src/stats/inc/MetropolisHastingsSG.h index c35e34b29..440a32afe 100644 --- a/src/stats/inc/MetropolisHastingsSG.h +++ b/src/stats/inc/MetropolisHastingsSG.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MetropolisHastingsSGOptions.h b/src/stats/inc/MetropolisHastingsSGOptions.h index 91e98c987..0582a77e2 100644 --- a/src/stats/inc/MetropolisHastingsSGOptions.h +++ b/src/stats/inc/MetropolisHastingsSGOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ModelValidation.h b/src/stats/inc/ModelValidation.h index cc97c36ff..374e2921a 100644 --- a/src/stats/inc/ModelValidation.h +++ b/src/stats/inc/ModelValidation.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MonteCarloSG.h b/src/stats/inc/MonteCarloSG.h index c3daf5d0e..4a3db7871 100644 --- a/src/stats/inc/MonteCarloSG.h +++ b/src/stats/inc/MonteCarloSG.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/MonteCarloSGOptions.h b/src/stats/inc/MonteCarloSGOptions.h index a20d360ea..466c1596f 100644 --- a/src/stats/inc/MonteCarloSGOptions.h +++ b/src/stats/inc/MonteCarloSGOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/PoweredJointPdf.h b/src/stats/inc/PoweredJointPdf.h index f81afa261..a6ec2589a 100644 --- a/src/stats/inc/PoweredJointPdf.h +++ b/src/stats/inc/PoweredJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/SampledScalarCdf.h b/src/stats/inc/SampledScalarCdf.h index 800ce2cd5..c65378556 100644 --- a/src/stats/inc/SampledScalarCdf.h +++ b/src/stats/inc/SampledScalarCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/SampledVectorCdf.h b/src/stats/inc/SampledVectorCdf.h index 6bd3a5f62..0e73c4888 100644 --- a/src/stats/inc/SampledVectorCdf.h +++ b/src/stats/inc/SampledVectorCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/SampledVectorMdf.h b/src/stats/inc/SampledVectorMdf.h index 6e0cf96b9..9406dd85c 100644 --- a/src/stats/inc/SampledVectorMdf.h +++ b/src/stats/inc/SampledVectorMdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ScalarCdf.h b/src/stats/inc/ScalarCdf.h index fc97aab91..3e3469b4d 100644 --- a/src/stats/inc/ScalarCdf.h +++ b/src/stats/inc/ScalarCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ScalarCovarianceFunction.h b/src/stats/inc/ScalarCovarianceFunction.h index d812bdebf..b6c8e437d 100644 --- a/src/stats/inc/ScalarCovarianceFunction.h +++ b/src/stats/inc/ScalarCovarianceFunction.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ScalarGaussianRandomField.h b/src/stats/inc/ScalarGaussianRandomField.h index 39126cce0..086d1922f 100644 --- a/src/stats/inc/ScalarGaussianRandomField.h +++ b/src/stats/inc/ScalarGaussianRandomField.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ScaledCovMatrixTKGroup.h b/src/stats/inc/ScaledCovMatrixTKGroup.h index 8aab8cae0..57dbf8b87 100644 --- a/src/stats/inc/ScaledCovMatrixTKGroup.h +++ b/src/stats/inc/ScaledCovMatrixTKGroup.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/SequentialVectorRealizer.h b/src/stats/inc/SequentialVectorRealizer.h index 4157157ce..a97fe47ca 100644 --- a/src/stats/inc/SequentialVectorRealizer.h +++ b/src/stats/inc/SequentialVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/StatisticalForwardProblem.h b/src/stats/inc/StatisticalForwardProblem.h index bf7d0cc85..945eafb61 100644 --- a/src/stats/inc/StatisticalForwardProblem.h +++ b/src/stats/inc/StatisticalForwardProblem.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/StatisticalForwardProblemOptions.h b/src/stats/inc/StatisticalForwardProblemOptions.h index d7bfad64e..b3cb00d6b 100644 --- a/src/stats/inc/StatisticalForwardProblemOptions.h +++ b/src/stats/inc/StatisticalForwardProblemOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/StatisticalInverseProblem.h b/src/stats/inc/StatisticalInverseProblem.h index 7e398cdf8..ef1e8eb25 100644 --- a/src/stats/inc/StatisticalInverseProblem.h +++ b/src/stats/inc/StatisticalInverseProblem.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/StatisticalInverseProblemOptions.h b/src/stats/inc/StatisticalInverseProblemOptions.h index 85fee0056..915d3e0eb 100644 --- a/src/stats/inc/StatisticalInverseProblemOptions.h +++ b/src/stats/inc/StatisticalInverseProblemOptions.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/StdScalarCdf.h b/src/stats/inc/StdScalarCdf.h index b5b4dc379..6ebd0493d 100644 --- a/src/stats/inc/StdScalarCdf.h +++ b/src/stats/inc/StdScalarCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/TKGroup.h b/src/stats/inc/TKGroup.h index 6b8833dd4..a134d98d2 100644 --- a/src/stats/inc/TKGroup.h +++ b/src/stats/inc/TKGroup.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/TransformedScaledCovMatrixTKGroup.h b/src/stats/inc/TransformedScaledCovMatrixTKGroup.h index 1facad393..eb29f4cb7 100644 --- a/src/stats/inc/TransformedScaledCovMatrixTKGroup.h +++ b/src/stats/inc/TransformedScaledCovMatrixTKGroup.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/UniformJointPdf.h b/src/stats/inc/UniformJointPdf.h index b6bb5d694..342ca6e5e 100644 --- a/src/stats/inc/UniformJointPdf.h +++ b/src/stats/inc/UniformJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/UniformVectorRV.h b/src/stats/inc/UniformVectorRV.h index 619d31bc2..c0d3fb4d9 100644 --- a/src/stats/inc/UniformVectorRV.h +++ b/src/stats/inc/UniformVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/UniformVectorRealizer.h b/src/stats/inc/UniformVectorRealizer.h index 627fb74f0..5e2f76830 100644 --- a/src/stats/inc/UniformVectorRealizer.h +++ b/src/stats/inc/UniformVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/ValidationCycle.h b/src/stats/inc/ValidationCycle.h index 0c6c6ca31..b51b5e1ad 100644 --- a/src/stats/inc/ValidationCycle.h +++ b/src/stats/inc/ValidationCycle.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/VectorCdf.h b/src/stats/inc/VectorCdf.h index e392317cb..40518b4fb 100644 --- a/src/stats/inc/VectorCdf.h +++ b/src/stats/inc/VectorCdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/VectorGaussianRandomField.h b/src/stats/inc/VectorGaussianRandomField.h index b8b4dc7c5..87dd1c5c2 100644 --- a/src/stats/inc/VectorGaussianRandomField.h +++ b/src/stats/inc/VectorGaussianRandomField.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/VectorMdf.h b/src/stats/inc/VectorMdf.h index f1bbdebb5..7bf54411c 100644 --- a/src/stats/inc/VectorMdf.h +++ b/src/stats/inc/VectorMdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/VectorRV.h b/src/stats/inc/VectorRV.h index d3d8db258..b4428d894 100644 --- a/src/stats/inc/VectorRV.h +++ b/src/stats/inc/VectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/VectorRealizer.h b/src/stats/inc/VectorRealizer.h index 92f970f06..5d576c1f4 100644 --- a/src/stats/inc/VectorRealizer.h +++ b/src/stats/inc/VectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/WignerJointPdf.h b/src/stats/inc/WignerJointPdf.h index 67aa7ac24..50ac3b3cd 100644 --- a/src/stats/inc/WignerJointPdf.h +++ b/src/stats/inc/WignerJointPdf.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/WignerVectorRV.h b/src/stats/inc/WignerVectorRV.h index ff420b581..da49fca17 100644 --- a/src/stats/inc/WignerVectorRV.h +++ b/src/stats/inc/WignerVectorRV.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/inc/WignerVectorRealizer.h b/src/stats/inc/WignerVectorRealizer.h index 1cc082b46..abdd0bcd1 100644 --- a/src/stats/inc/WignerVectorRealizer.h +++ b/src/stats/inc/WignerVectorRealizer.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/BayesianJointPdf.C b/src/stats/src/BayesianJointPdf.C index d92f3bb8b..6f7a68770 100644 --- a/src/stats/src/BayesianJointPdf.C +++ b/src/stats/src/BayesianJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/BetaJointPdf.C b/src/stats/src/BetaJointPdf.C index bd424b9bf..adb20809d 100644 --- a/src/stats/src/BetaJointPdf.C +++ b/src/stats/src/BetaJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/BetaVectorRV.C b/src/stats/src/BetaVectorRV.C index 752fdc94e..36a3d47a9 100644 --- a/src/stats/src/BetaVectorRV.C +++ b/src/stats/src/BetaVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/BetaVectorRealizer.C b/src/stats/src/BetaVectorRealizer.C index 3d929c102..9deb3ad2b 100644 --- a/src/stats/src/BetaVectorRealizer.C +++ b/src/stats/src/BetaVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ConcatenatedJointPdf.C b/src/stats/src/ConcatenatedJointPdf.C index adeec3d02..ce790323f 100644 --- a/src/stats/src/ConcatenatedJointPdf.C +++ b/src/stats/src/ConcatenatedJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ConcatenatedVectorRV.C b/src/stats/src/ConcatenatedVectorRV.C index 58bc72959..4c31a05c6 100644 --- a/src/stats/src/ConcatenatedVectorRV.C +++ b/src/stats/src/ConcatenatedVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ConcatenatedVectorRealizer.C b/src/stats/src/ConcatenatedVectorRealizer.C index 5a5584841..dc93d518b 100644 --- a/src/stats/src/ConcatenatedVectorRealizer.C +++ b/src/stats/src/ConcatenatedVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ExponentialMatrixCovarianceFunction.C b/src/stats/src/ExponentialMatrixCovarianceFunction.C index e10d7bf00..95e01db09 100644 --- a/src/stats/src/ExponentialMatrixCovarianceFunction.C +++ b/src/stats/src/ExponentialMatrixCovarianceFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ExponentialScalarCovarianceFunction.C b/src/stats/src/ExponentialScalarCovarianceFunction.C index faed85311..607d412bf 100644 --- a/src/stats/src/ExponentialScalarCovarianceFunction.C +++ b/src/stats/src/ExponentialScalarCovarianceFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/FiniteDistribution.C b/src/stats/src/FiniteDistribution.C index e2b2716ad..f95590497 100644 --- a/src/stats/src/FiniteDistribution.C +++ b/src/stats/src/FiniteDistribution.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GammaJointPdf.C b/src/stats/src/GammaJointPdf.C index 2bc2b4ad8..29b575c34 100644 --- a/src/stats/src/GammaJointPdf.C +++ b/src/stats/src/GammaJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GammaVectorRV.C b/src/stats/src/GammaVectorRV.C index 33f01c9c3..c9d9f7979 100644 --- a/src/stats/src/GammaVectorRV.C +++ b/src/stats/src/GammaVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GammaVectorRealizer.C b/src/stats/src/GammaVectorRealizer.C index bfa9a6e5b..6130de162 100644 --- a/src/stats/src/GammaVectorRealizer.C +++ b/src/stats/src/GammaVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GaussianJointPdf.C b/src/stats/src/GaussianJointPdf.C index ec2f8be9b..5e00130ed 100644 --- a/src/stats/src/GaussianJointPdf.C +++ b/src/stats/src/GaussianJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GaussianVectorCdf.C b/src/stats/src/GaussianVectorCdf.C index 2fc505bf6..6ab68269f 100644 --- a/src/stats/src/GaussianVectorCdf.C +++ b/src/stats/src/GaussianVectorCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GaussianVectorMdf.C b/src/stats/src/GaussianVectorMdf.C index 1094ed709..1943789de 100644 --- a/src/stats/src/GaussianVectorMdf.C +++ b/src/stats/src/GaussianVectorMdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GaussianVectorRV.C b/src/stats/src/GaussianVectorRV.C index 538554512..1c5861ad5 100644 --- a/src/stats/src/GaussianVectorRV.C +++ b/src/stats/src/GaussianVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GaussianVectorRealizer.C b/src/stats/src/GaussianVectorRealizer.C index 257368598..fe04b702a 100644 --- a/src/stats/src/GaussianVectorRealizer.C +++ b/src/stats/src/GaussianVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericJointPdf.C b/src/stats/src/GenericJointPdf.C index ac73c7dcb..f5a736735 100644 --- a/src/stats/src/GenericJointPdf.C +++ b/src/stats/src/GenericJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericMatrixCovarianceFunction.C b/src/stats/src/GenericMatrixCovarianceFunction.C index 1a654e7ac..08430bf32 100644 --- a/src/stats/src/GenericMatrixCovarianceFunction.C +++ b/src/stats/src/GenericMatrixCovarianceFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericScalarCovarianceFunction.C b/src/stats/src/GenericScalarCovarianceFunction.C index 803f2f1e1..eda48365d 100644 --- a/src/stats/src/GenericScalarCovarianceFunction.C +++ b/src/stats/src/GenericScalarCovarianceFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericVectorCdf.C b/src/stats/src/GenericVectorCdf.C index 59f6753bb..466fde6a3 100644 --- a/src/stats/src/GenericVectorCdf.C +++ b/src/stats/src/GenericVectorCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericVectorMdf.C b/src/stats/src/GenericVectorMdf.C index ff8114468..a53afb66e 100644 --- a/src/stats/src/GenericVectorMdf.C +++ b/src/stats/src/GenericVectorMdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericVectorRV.C b/src/stats/src/GenericVectorRV.C index 01c10837b..06d448949 100644 --- a/src/stats/src/GenericVectorRV.C +++ b/src/stats/src/GenericVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/GenericVectorRealizer.C b/src/stats/src/GenericVectorRealizer.C index 486077eeb..f2d219f83 100644 --- a/src/stats/src/GenericVectorRealizer.C +++ b/src/stats/src/GenericVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/HessianCovMatricesTKGroup.C b/src/stats/src/HessianCovMatricesTKGroup.C index 0e131c809..d1aad57c4 100644 --- a/src/stats/src/HessianCovMatricesTKGroup.C +++ b/src/stats/src/HessianCovMatricesTKGroup.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InfoTheory.C b/src/stats/src/InfoTheory.C index e9caf6bac..2bc6df60f 100644 --- a/src/stats/src/InfoTheory.C +++ b/src/stats/src/InfoTheory.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InvLogitGaussianJointPdf.C b/src/stats/src/InvLogitGaussianJointPdf.C index 273c9a7d7..b7832bc6d 100644 --- a/src/stats/src/InvLogitGaussianJointPdf.C +++ b/src/stats/src/InvLogitGaussianJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InvLogitGaussianVectorRV.C b/src/stats/src/InvLogitGaussianVectorRV.C index cfee78dbf..839d4d468 100644 --- a/src/stats/src/InvLogitGaussianVectorRV.C +++ b/src/stats/src/InvLogitGaussianVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InvLogitGaussianVectorRealizer.C b/src/stats/src/InvLogitGaussianVectorRealizer.C index 7be731666..fe8257c34 100644 --- a/src/stats/src/InvLogitGaussianVectorRealizer.C +++ b/src/stats/src/InvLogitGaussianVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InverseGammaJointPdf.C b/src/stats/src/InverseGammaJointPdf.C index dd911bfe2..2f5ee2ec2 100644 --- a/src/stats/src/InverseGammaJointPdf.C +++ b/src/stats/src/InverseGammaJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InverseGammaVectorRV.C b/src/stats/src/InverseGammaVectorRV.C index 759641b61..bff9240b2 100644 --- a/src/stats/src/InverseGammaVectorRV.C +++ b/src/stats/src/InverseGammaVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/InverseGammaVectorRealizer.C b/src/stats/src/InverseGammaVectorRealizer.C index 8507f4ca8..321d65834 100644 --- a/src/stats/src/InverseGammaVectorRealizer.C +++ b/src/stats/src/InverseGammaVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/JeffreysJointPdf.C b/src/stats/src/JeffreysJointPdf.C index ac5cb3234..6cabae1d7 100644 --- a/src/stats/src/JeffreysJointPdf.C +++ b/src/stats/src/JeffreysJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/JeffreysVectorRV.C b/src/stats/src/JeffreysVectorRV.C index a50c333b6..7a55a5317 100644 --- a/src/stats/src/JeffreysVectorRV.C +++ b/src/stats/src/JeffreysVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/JeffreysVectorRealizer.C b/src/stats/src/JeffreysVectorRealizer.C index 43b30d684..7e30abcb5 100644 --- a/src/stats/src/JeffreysVectorRealizer.C +++ b/src/stats/src/JeffreysVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/JointPdf.C b/src/stats/src/JointPdf.C index ad09f0228..35872fa78 100644 --- a/src/stats/src/JointPdf.C +++ b/src/stats/src/JointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/LogNormalJointPdf.C b/src/stats/src/LogNormalJointPdf.C index c450d0a98..7fb99970e 100644 --- a/src/stats/src/LogNormalJointPdf.C +++ b/src/stats/src/LogNormalJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/LogNormalVectorRV.C b/src/stats/src/LogNormalVectorRV.C index 6c8893f5e..cf29cb0e8 100644 --- a/src/stats/src/LogNormalVectorRV.C +++ b/src/stats/src/LogNormalVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/LogNormalVectorRealizer.C b/src/stats/src/LogNormalVectorRealizer.C index 3e3ef3ecd..3226204cc 100644 --- a/src/stats/src/LogNormalVectorRealizer.C +++ b/src/stats/src/LogNormalVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MLSampling.C b/src/stats/src/MLSampling.C index 6721f42fa..37647b095 100644 --- a/src/stats/src/MLSampling.C +++ b/src/stats/src/MLSampling.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MLSamplingLevelOptions.C b/src/stats/src/MLSamplingLevelOptions.C index 2b2d30496..20f8a4040 100644 --- a/src/stats/src/MLSamplingLevelOptions.C +++ b/src/stats/src/MLSamplingLevelOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MLSamplingOptions.C b/src/stats/src/MLSamplingOptions.C index 594421cba..06b8f8990 100644 --- a/src/stats/src/MLSamplingOptions.C +++ b/src/stats/src/MLSamplingOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MarkovChainPositionData.C b/src/stats/src/MarkovChainPositionData.C index fa9f48be3..5ffce6eb0 100644 --- a/src/stats/src/MarkovChainPositionData.C +++ b/src/stats/src/MarkovChainPositionData.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MatrixCovarianceFunction.C b/src/stats/src/MatrixCovarianceFunction.C index 8376135cf..3950e48a0 100644 --- a/src/stats/src/MatrixCovarianceFunction.C +++ b/src/stats/src/MatrixCovarianceFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MetropolisHastingsSG.C b/src/stats/src/MetropolisHastingsSG.C index 9f42c2c6c..104118344 100644 --- a/src/stats/src/MetropolisHastingsSG.C +++ b/src/stats/src/MetropolisHastingsSG.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MetropolisHastingsSGOptions.C b/src/stats/src/MetropolisHastingsSGOptions.C index 9437cf080..2d5b55d98 100644 --- a/src/stats/src/MetropolisHastingsSGOptions.C +++ b/src/stats/src/MetropolisHastingsSGOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ModelValidation.C b/src/stats/src/ModelValidation.C index 4f9725765..9733fbe1a 100644 --- a/src/stats/src/ModelValidation.C +++ b/src/stats/src/ModelValidation.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MonteCarloSG.C b/src/stats/src/MonteCarloSG.C index 28610e248..bc4533883 100644 --- a/src/stats/src/MonteCarloSG.C +++ b/src/stats/src/MonteCarloSG.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/MonteCarloSGOptions.C b/src/stats/src/MonteCarloSGOptions.C index 7c8fa8299..a42bddf5e 100644 --- a/src/stats/src/MonteCarloSGOptions.C +++ b/src/stats/src/MonteCarloSGOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/PoweredJointPdf.C b/src/stats/src/PoweredJointPdf.C index 411dc2bac..545c9c613 100644 --- a/src/stats/src/PoweredJointPdf.C +++ b/src/stats/src/PoweredJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/SampledScalarCdf.C b/src/stats/src/SampledScalarCdf.C index 99f20c453..4f8811438 100644 --- a/src/stats/src/SampledScalarCdf.C +++ b/src/stats/src/SampledScalarCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/SampledVectorCdf.C b/src/stats/src/SampledVectorCdf.C index 8313a69a0..90fc79046 100644 --- a/src/stats/src/SampledVectorCdf.C +++ b/src/stats/src/SampledVectorCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/SampledVectorMdf.C b/src/stats/src/SampledVectorMdf.C index 637c3d29e..2a83c1bf8 100644 --- a/src/stats/src/SampledVectorMdf.C +++ b/src/stats/src/SampledVectorMdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ScalarCdf.C b/src/stats/src/ScalarCdf.C index 5c3f0994c..3b7d945f2 100644 --- a/src/stats/src/ScalarCdf.C +++ b/src/stats/src/ScalarCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ScalarCovarianceFunction.C b/src/stats/src/ScalarCovarianceFunction.C index 60fa53f13..677a5c42c 100644 --- a/src/stats/src/ScalarCovarianceFunction.C +++ b/src/stats/src/ScalarCovarianceFunction.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ScalarGaussianRandomField.C b/src/stats/src/ScalarGaussianRandomField.C index a05d2d9ec..f79d19eee 100644 --- a/src/stats/src/ScalarGaussianRandomField.C +++ b/src/stats/src/ScalarGaussianRandomField.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ScaledCovMatrixTKGroup.C b/src/stats/src/ScaledCovMatrixTKGroup.C index 0327eac83..6957278fa 100644 --- a/src/stats/src/ScaledCovMatrixTKGroup.C +++ b/src/stats/src/ScaledCovMatrixTKGroup.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/SequentialVectorRealizer.C b/src/stats/src/SequentialVectorRealizer.C index 908d89cef..84c475a2e 100644 --- a/src/stats/src/SequentialVectorRealizer.C +++ b/src/stats/src/SequentialVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/StatisticalForwardProblem.C b/src/stats/src/StatisticalForwardProblem.C index ae6b1950c..f1bfbe6b5 100644 --- a/src/stats/src/StatisticalForwardProblem.C +++ b/src/stats/src/StatisticalForwardProblem.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/StatisticalForwardProblemOptions.C b/src/stats/src/StatisticalForwardProblemOptions.C index 6a8a403a8..6862c3ef1 100644 --- a/src/stats/src/StatisticalForwardProblemOptions.C +++ b/src/stats/src/StatisticalForwardProblemOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/StatisticalInverseProblem.C b/src/stats/src/StatisticalInverseProblem.C index 13a97a2b0..34253a680 100644 --- a/src/stats/src/StatisticalInverseProblem.C +++ b/src/stats/src/StatisticalInverseProblem.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/StatisticalInverseProblemOptions.C b/src/stats/src/StatisticalInverseProblemOptions.C index cbab0f18f..e5dbbeacc 100644 --- a/src/stats/src/StatisticalInverseProblemOptions.C +++ b/src/stats/src/StatisticalInverseProblemOptions.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/StdScalarCdf.C b/src/stats/src/StdScalarCdf.C index 112fbd4b9..811e072da 100644 --- a/src/stats/src/StdScalarCdf.C +++ b/src/stats/src/StdScalarCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/TKGroup.C b/src/stats/src/TKGroup.C index bcd047dbf..82f555477 100644 --- a/src/stats/src/TKGroup.C +++ b/src/stats/src/TKGroup.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/TransformedScaledCovMatrixTKGroup.C b/src/stats/src/TransformedScaledCovMatrixTKGroup.C index 53574280b..a924deb38 100644 --- a/src/stats/src/TransformedScaledCovMatrixTKGroup.C +++ b/src/stats/src/TransformedScaledCovMatrixTKGroup.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/UniformJointPdf.C b/src/stats/src/UniformJointPdf.C index bbcb15177..47ed7f31e 100644 --- a/src/stats/src/UniformJointPdf.C +++ b/src/stats/src/UniformJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/UniformVectorRV.C b/src/stats/src/UniformVectorRV.C index 4fd8cd5ff..5e624944d 100644 --- a/src/stats/src/UniformVectorRV.C +++ b/src/stats/src/UniformVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/UniformVectorRealizer.C b/src/stats/src/UniformVectorRealizer.C index a70e2b2ac..d18b44986 100644 --- a/src/stats/src/UniformVectorRealizer.C +++ b/src/stats/src/UniformVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/ValidationCycle.C b/src/stats/src/ValidationCycle.C index db5be1e20..262a0f501 100644 --- a/src/stats/src/ValidationCycle.C +++ b/src/stats/src/ValidationCycle.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/VectorCdf.C b/src/stats/src/VectorCdf.C index dd3c6cb7e..c01eaf368 100644 --- a/src/stats/src/VectorCdf.C +++ b/src/stats/src/VectorCdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/VectorGaussianRandomField.C b/src/stats/src/VectorGaussianRandomField.C index a7c9f2ec3..e78eefe29 100644 --- a/src/stats/src/VectorGaussianRandomField.C +++ b/src/stats/src/VectorGaussianRandomField.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/VectorMdf.C b/src/stats/src/VectorMdf.C index bd9cdf833..89f1d582f 100644 --- a/src/stats/src/VectorMdf.C +++ b/src/stats/src/VectorMdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/VectorRV.C b/src/stats/src/VectorRV.C index 39ecc3b0d..d710d7149 100644 --- a/src/stats/src/VectorRV.C +++ b/src/stats/src/VectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/VectorRealizer.C b/src/stats/src/VectorRealizer.C index ea02d37c8..be9e88715 100644 --- a/src/stats/src/VectorRealizer.C +++ b/src/stats/src/VectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/WignerJointPdf.C b/src/stats/src/WignerJointPdf.C index dbd849a9e..87c5c572b 100644 --- a/src/stats/src/WignerJointPdf.C +++ b/src/stats/src/WignerJointPdf.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/WignerVectorRV.C b/src/stats/src/WignerVectorRV.C index be9b63e9f..efa54112b 100644 --- a/src/stats/src/WignerVectorRV.C +++ b/src/stats/src/WignerVectorRV.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/src/stats/src/WignerVectorRealizer.C b/src/stats/src/WignerVectorRealizer.C index 5de3546c5..de741262b 100644 --- a/src/stats/src/WignerVectorRealizer.C +++ b/src/stats/src/WignerVectorRealizer.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/get_min_max_vec.C b/test/gsl_tests/get_min_max_vec.C index 295915dd6..2e1a2eeb8 100644 --- a/test/gsl_tests/get_min_max_vec.C +++ b/test/gsl_tests/get_min_max_vec.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/get_min_max_vec.h b/test/gsl_tests/get_min_max_vec.h index bd6f78be5..0e5ddc202 100644 --- a/test/gsl_tests/get_min_max_vec.h +++ b/test/gsl_tests/get_min_max_vec.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/get_set_row_column.C b/test/gsl_tests/get_set_row_column.C index 97820bb26..2027b19bc 100644 --- a/test/gsl_tests/get_set_row_column.C +++ b/test/gsl_tests/get_set_row_column.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/get_set_row_column.h b/test/gsl_tests/get_set_row_column.h index e55bd418c..01f9072dc 100644 --- a/test/gsl_tests/get_set_row_column.h +++ b/test/gsl_tests/get_set_row_column.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/inverse_power_method.C b/test/gsl_tests/inverse_power_method.C index 66bea28d9..35b089cee 100644 --- a/test/gsl_tests/inverse_power_method.C +++ b/test/gsl_tests/inverse_power_method.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/inverse_power_method.h b/test/gsl_tests/inverse_power_method.h index bfd378240..3967d0b11 100644 --- a/test/gsl_tests/inverse_power_method.h +++ b/test/gsl_tests/inverse_power_method.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/multiple_rhs_matrix_solve.C b/test/gsl_tests/multiple_rhs_matrix_solve.C index a40f71b7b..b4ac80e3d 100644 --- a/test/gsl_tests/multiple_rhs_matrix_solve.C +++ b/test/gsl_tests/multiple_rhs_matrix_solve.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/multiple_rhs_matrix_solve.h b/test/gsl_tests/multiple_rhs_matrix_solve.h index e027d2b32..35e70ff50 100644 --- a/test/gsl_tests/multiple_rhs_matrix_solve.h +++ b/test/gsl_tests/multiple_rhs_matrix_solve.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/power_method.C b/test/gsl_tests/power_method.C index c5c58e6fc..1e2327155 100644 --- a/test/gsl_tests/power_method.C +++ b/test/gsl_tests/power_method.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/gsl_tests/power_method.h b/test/gsl_tests/power_method.h index f910256f4..4e8f23d70 100644 --- a/test/gsl_tests/power_method.h +++ b/test/gsl_tests/power_method.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t01_valid_cycle/TgaValidationCycle_appl.h b/test/t01_valid_cycle/TgaValidationCycle_appl.h index 53d6fcf10..ff7186f5b 100644 --- a/test/t01_valid_cycle/TgaValidationCycle_appl.h +++ b/test/t01_valid_cycle/TgaValidationCycle_appl.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t01_valid_cycle/TgaValidationCycle_gsl.C b/test/t01_valid_cycle/TgaValidationCycle_gsl.C index 1556fcc01..d0a2860ed 100644 --- a/test/t01_valid_cycle/TgaValidationCycle_gsl.C +++ b/test/t01_valid_cycle/TgaValidationCycle_gsl.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t01_valid_cycle/TgaValidationCycle_likelihood.h b/test/t01_valid_cycle/TgaValidationCycle_likelihood.h index 46592b44b..c405c0db7 100644 --- a/test/t01_valid_cycle/TgaValidationCycle_likelihood.h +++ b/test/t01_valid_cycle/TgaValidationCycle_likelihood.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t01_valid_cycle/TgaValidationCycle_qoi.h b/test/t01_valid_cycle/TgaValidationCycle_qoi.h index f555606e6..67c18ba2f 100644 --- a/test/t01_valid_cycle/TgaValidationCycle_qoi.h +++ b/test/t01_valid_cycle/TgaValidationCycle_qoi.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_compute.C b/test/t02_sip_sfp/example_compute.C index 866aacea4..b89bb7f37 100644 --- a/test/t02_sip_sfp/example_compute.C +++ b/test/t02_sip_sfp/example_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_compute.h b/test/t02_sip_sfp/example_compute.h index c800487a7..4801689da 100644 --- a/test/t02_sip_sfp/example_compute.h +++ b/test/t02_sip_sfp/example_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_likelihood.C b/test/t02_sip_sfp/example_likelihood.C index 827370b0d..bb80c26f3 100644 --- a/test/t02_sip_sfp/example_likelihood.C +++ b/test/t02_sip_sfp/example_likelihood.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_likelihood.h b/test/t02_sip_sfp/example_likelihood.h index a167e5496..688cdfe84 100644 --- a/test/t02_sip_sfp/example_likelihood.h +++ b/test/t02_sip_sfp/example_likelihood.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_main.C b/test/t02_sip_sfp/example_main.C index 57fd96b88..c33d87059 100644 --- a/test/t02_sip_sfp/example_main.C +++ b/test/t02_sip_sfp/example_main.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_qoi.C b/test/t02_sip_sfp/example_qoi.C index a712c7697..20dea729b 100644 --- a/test/t02_sip_sfp/example_qoi.C +++ b/test/t02_sip_sfp/example_qoi.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t02_sip_sfp/example_qoi.h b/test/t02_sip_sfp/example_qoi.h index b418827fb..b714e64dc 100644 --- a/test/t02_sip_sfp/example_qoi.h +++ b/test/t02_sip_sfp/example_qoi.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t03_sequence/example_compute.C b/test/t03_sequence/example_compute.C index 2956b5a64..b55b3ffbb 100644 --- a/test/t03_sequence/example_compute.C +++ b/test/t03_sequence/example_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t03_sequence/example_compute.h b/test/t03_sequence/example_compute.h index c800487a7..4801689da 100644 --- a/test/t03_sequence/example_compute.h +++ b/test/t03_sequence/example_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t03_sequence/example_main.C b/test/t03_sequence/example_main.C index 5443f9303..ee47f0a26 100644 --- a/test/t03_sequence/example_main.C +++ b/test/t03_sequence/example_main.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t04_bimodal/example_compute.C b/test/t04_bimodal/example_compute.C index 490d60b2c..6c41edcf1 100644 --- a/test/t04_bimodal/example_compute.C +++ b/test/t04_bimodal/example_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t04_bimodal/example_compute.h b/test/t04_bimodal/example_compute.h index fcd66a87b..dec479377 100644 --- a/test/t04_bimodal/example_compute.h +++ b/test/t04_bimodal/example_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t04_bimodal/example_likelihood.C b/test/t04_bimodal/example_likelihood.C index 75bf9b8ea..1d53b019a 100644 --- a/test/t04_bimodal/example_likelihood.C +++ b/test/t04_bimodal/example_likelihood.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t04_bimodal/example_likelihood.h b/test/t04_bimodal/example_likelihood.h index 4bd14f483..a6adf7052 100644 --- a/test/t04_bimodal/example_likelihood.h +++ b/test/t04_bimodal/example_likelihood.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/test/t04_bimodal/example_main.C b/test/t04_bimodal/example_main.C index 2714db53f..1c98d1163 100644 --- a/test/t04_bimodal/example_main.C +++ b/test/t04_bimodal/example_main.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General From 00b8f82bfd20cf3776dcdf16cd1941748b085f2e Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 16 Dec 2014 15:31:21 -0600 Subject: [PATCH 18/99] Add back in the error messages --- examples/gravity/src/gravity_qoi.C | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/gravity/src/gravity_qoi.C b/examples/gravity/src/gravity_qoi.C index c8792f396..aaf7461be 100644 --- a/examples/gravity/src/gravity_qoi.C +++ b/examples/gravity/src/gravity_qoi.C @@ -57,6 +57,13 @@ Qoi::compute(const P_V & domainVector, QUESO::DistArray * hessianMatrices, QUESO::DistArray * hessianEffects) const { + if (domainVector.sizeLocal() != 1) { + queso_error_msg("domainVector does not have size 1"); + } + if (imageVector.sizeLocal() != 1) { + queso_error_msg("imageVector does not have size 1"); + } + double g = domainVector[0]; // Sample of the RV 'gravity acceleration' double distanceTraveled = 0.0; double aux = m_initialVelocity * std::sin(m_angle); From b903ca346dab8aacba4e6c435f7ab0f4868f185a Mon Sep 17 00:00:00 2001 From: "Roy H. Stogner" Date: Wed, 17 Dec 2014 14:09:50 -0600 Subject: [PATCH 19/99] Ignore LaTeX intermediate/output files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index bf0813258..2130e5595 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ Makefile.in Makefile !manual/Makefile +manual/mixed_effects/*.pdf +manual/mixed_effects/*.aux libtool sl6-config stamp-h1 From e4673050538fcc3c4ec8ff7495f0f7cdcf35ed08 Mon Sep 17 00:00:00 2001 From: "Paul T. Bauman" Date: Wed, 31 Dec 2014 15:24:25 -0500 Subject: [PATCH 20/99] Fix typo in GSLOptimizer solver type name. Fix typo in GSL solver type name. Fixes #304. --- src/core/inc/GslOptimizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/inc/GslOptimizer.h b/src/core/inc/GslOptimizer.h index 7ff59e391..c978e908e 100644 --- a/src/core/inc/GslOptimizer.h +++ b/src/core/inc/GslOptimizer.h @@ -72,7 +72,7 @@ class GslOptimizer : public BaseOptimizer { POLAK_RIBIERE_CG, BFGS, BFGS2, - STEEPEST_DECENT, + STEEPEST_DESCENT, NELDER_MEAD, NELDER_MEAD2, NELDER_MEAD2_RAND }; From 87f44ea79a6004e94e7c5b4bf87702f3fdcf0a93 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 6 Jan 2015 17:47:53 -0600 Subject: [PATCH 21/99] Fix sign in log uniform pdf --- src/stats/src/UniformJointPdf.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats/src/UniformJointPdf.C b/src/stats/src/UniformJointPdf.C index 47ed7f31e..d8a57e073 100644 --- a/src/stats/src/UniformJointPdf.C +++ b/src/stats/src/UniformJointPdf.C @@ -112,7 +112,7 @@ UniformJointPdf::lnValue( volume = 1.; } - return log(volume); // No need to add m_logOfNormalizationFactor [PDF-04] + return -log(volume); } //-------------------------------------------------- template From a183b61fee26e3cb33ab94d8806d83db62bdf04e Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Wed, 7 Jan 2015 10:43:13 -0600 Subject: [PATCH 22/99] Updating some outdated licence headers --- examples/gravity/src/gravity_compute.C | 2 +- examples/gravity/src/gravity_compute.h | 2 +- examples/gravity/src/gravity_likelihood.C | 2 +- examples/gravity/src/gravity_likelihood.h | 2 +- examples/gravity/src/gravity_qoi.C | 2 +- examples/gravity/src/gravity_qoi.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/gravity/src/gravity_compute.C b/examples/gravity/src/gravity_compute.C index a8c212743..4ceadd145 100644 --- a/examples/gravity/src/gravity_compute.C +++ b/examples/gravity/src/gravity_compute.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/gravity/src/gravity_compute.h b/examples/gravity/src/gravity_compute.h index cae98e5ee..c5690d4f7 100644 --- a/examples/gravity/src/gravity_compute.h +++ b/examples/gravity/src/gravity_compute.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/gravity/src/gravity_likelihood.C b/examples/gravity/src/gravity_likelihood.C index 9ce1a6267..e34edad3c 100644 --- a/examples/gravity/src/gravity_likelihood.C +++ b/examples/gravity/src/gravity_likelihood.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/gravity/src/gravity_likelihood.h b/examples/gravity/src/gravity_likelihood.h index 1bf0454ab..595ddef3a 100644 --- a/examples/gravity/src/gravity_likelihood.h +++ b/examples/gravity/src/gravity_likelihood.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/gravity/src/gravity_qoi.C b/examples/gravity/src/gravity_qoi.C index aaf7461be..2285c744a 100644 --- a/examples/gravity/src/gravity_qoi.C +++ b/examples/gravity/src/gravity_qoi.C @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General diff --git a/examples/gravity/src/gravity_qoi.h b/examples/gravity/src/gravity_qoi.h index b0be2735d..422df6e17 100644 --- a/examples/gravity/src/gravity_qoi.h +++ b/examples/gravity/src/gravity_qoi.h @@ -4,7 +4,7 @@ // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // -// Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team +// Copyright (C) 2008-2015 The PECOS Development Team // // This library is free software; you can redistribute it and/or // modify it under the terms of the Version 2.1 GNU Lesser General From 616165f99bab8796307dce8f3600b78cb2da4d37 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Wed, 7 Jan 2015 10:43:29 -0600 Subject: [PATCH 23/99] Fix typo in optimisation API --- src/core/src/GslOptimizer.C | 8 ++++---- test/test_optimizer/test_gsloptimizer.C | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/src/GslOptimizer.C b/src/core/src/GslOptimizer.C index 76deef1c7..4fe7a3d93 100644 --- a/src/core/src/GslOptimizer.C +++ b/src/core/src/GslOptimizer.C @@ -242,7 +242,7 @@ GslOptimizer::minimizer() const case(POLAK_RIBIERE_CG): case(BFGS): case(BFGS2): - case(STEEPEST_DECENT): + case(STEEPEST_DESCENT): { gradient_needed = true; break; @@ -288,7 +288,7 @@ GslOptimizer::minimizer() const case(BFGS2): type = gsl_multimin_fdfminimizer_vector_bfgs2; break; - case(STEEPEST_DECENT): + case(STEEPEST_DESCENT): type = gsl_multimin_fdfminimizer_steepest_descent; break; case(NELDER_MEAD): @@ -386,7 +386,7 @@ GslOptimizer::minimizer() const case(POLAK_RIBIERE_CG): case(BFGS): case(BFGS2): - case(STEEPEST_DECENT): + case(STEEPEST_DESCENT): default: // Wat?! queso_error(); @@ -485,7 +485,7 @@ GslOptimizer::minimizer() const else if( solver == std::string("bfgs2") ) solver_type = BFGS2; else if( solver == std::string("steepest_decent") ) - solver_type = STEEPEST_DECENT; + solver_type = STEEPEST_DESCENT; else if( solver == std::string("nelder_mead") ) solver_type = NELDER_MEAD; else if( solver == std::string("nelder_mead2") ) diff --git a/test/test_optimizer/test_gsloptimizer.C b/test/test_optimizer/test_gsloptimizer.C index 53cb821e4..28fbe31cd 100644 --- a/test/test_optimizer/test_gsloptimizer.C +++ b/test/test_optimizer/test_gsloptimizer.C @@ -76,7 +76,7 @@ int main(int argc, char ** argv) { double tol = 1.0e-10; optimizer.setTolerance(tol); - optimizer.set_solver_type(QUESO::GslOptimizer::STEEPEST_DECENT); + optimizer.set_solver_type(QUESO::GslOptimizer::STEEPEST_DESCENT); QUESO::OptimizerMonitor monitor(env); monitor.set_display_output(true,true); From fde30cbb572e35911ca55d3cab7ca9031c6efc28 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Wed, 21 Jan 2015 22:22:27 -0600 Subject: [PATCH 24/99] Adding scalar covariance Gaussian likelihoods --- inc/queso/Makefile.am | 6 ++ src/Makefile.am | 4 + src/stats/inc/GaussianLikelihood.h | 79 +++++++++++++++++++ .../inc/GaussianLikelihoodScalarCovariance.h | 71 +++++++++++++++++ src/stats/src/GaussianLikelihood.C | 48 +++++++++++ .../src/GaussianLikelihoodScalarCovariance.C | 74 +++++++++++++++++ 6 files changed, 282 insertions(+) create mode 100644 src/stats/inc/GaussianLikelihood.h create mode 100644 src/stats/inc/GaussianLikelihoodScalarCovariance.h create mode 100644 src/stats/src/GaussianLikelihood.C create mode 100644 src/stats/src/GaussianLikelihoodScalarCovariance.C diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index ba68c347b..7b9541934 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -105,6 +105,8 @@ BUILT_SOURCES += GammaJointPdf.h BUILT_SOURCES += GammaVectorRV.h BUILT_SOURCES += GammaVectorRealizer.h BUILT_SOURCES += GaussianJointPdf.h +BUILT_SOURCES += GaussianLikelihood.h +BUILT_SOURCES += GaussianLikelihoodScalarCovariance.h BUILT_SOURCES += GaussianVectorCdf.h BUILT_SOURCES += GaussianVectorMdf.h BUILT_SOURCES += GaussianVectorRV.h @@ -374,6 +376,10 @@ GammaVectorRealizer.h: $(top_srcdir)/src/stats/inc/GammaVectorRealizer.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianJointPdf.h: $(top_srcdir)/src/stats/inc/GaussianJointPdf.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihood.h: $(top_srcdir)/src/stats/inc/GaussianLikelihood.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihoodScalarCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodScalarCovariance.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianVectorCdf.h: $(top_srcdir)/src/stats/inc/GaussianVectorCdf.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianVectorMdf.h: $(top_srcdir)/src/stats/inc/GaussianVectorMdf.h diff --git a/src/Makefile.am b/src/Makefile.am index 29c8ad18c..711babf34 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -236,6 +236,8 @@ libqueso_la_SOURCES += stats/src/JeffreysVectorRV.C libqueso_la_SOURCES += stats/src/LogNormalVectorRV.C libqueso_la_SOURCES += stats/src/UniformVectorRV.C libqueso_la_SOURCES += stats/src/WignerVectorRV.C +libqueso_la_SOURCES += stats/src/GaussianLikelihood.C +libqueso_la_SOURCES += stats/src/GaussianLikelihoodScalarCovariance.C # Sources from gp/src @@ -418,6 +420,8 @@ libqueso_include_HEADERS += stats/inc/ExponentialMatrixCovarianceFunction.h libqueso_include_HEADERS += stats/inc/GenericMatrixCovarianceFunction.h libqueso_include_HEADERS += stats/inc/ScalarGaussianRandomField.h libqueso_include_HEADERS += stats/inc/VectorGaussianRandomField.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihood.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h # Headers to install from gp/inc diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h new file mode 100644 index 000000000..7c63333e6 --- /dev/null +++ b/src/stats/inc/GaussianLikelihood.h @@ -0,0 +1,79 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LLHD_H +#define UQ_GAUSSIAN_LLHD_H + +#include + +namespace QUESO { + +/*! + * \file BaseGaussianLikelihood.h + * + * \class BaseGaussianLikelihood + * \brief Base class for canned Gaussian likelihoods + * + * This class is an abstract base class for 'canned' Gaussian likelihoods. All + * this class does is add a pure virtual function called \c evaluateModel that + * the user will implement to interact with the forward code. + */ + +template +class BaseGaussianLikelihood : public BaseScalarFunction { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * The vector of observations must be passed. This will be used when + * evaluating the likelihood functional + */ + BaseGaussianLikelihood(const char * prefix, + const VectorSet & domainSet, const double * observations); + + //! Destructor + virtual ~BaseGaussianLikelihood(); + //@} + + //! Evaluates the user's model at the point \c domainVector + /*! + * This is pure virtual, so the user must implement this when subclassing a + * Gaussian likelihood class. Note that, what is returned is not an object + * of type \c V, but an array of type \c double. This represents a vector of + * synthetic observations that will be to compare to actual observations when + * computing the likelihood functional. + */ + virtual double * evaluateModel(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const = 0; + +//protected: + double * m_modelOutput; + const double * m_observations; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LLHD_H diff --git a/src/stats/inc/GaussianLikelihoodScalarCovariance.h b/src/stats/inc/GaussianLikelihoodScalarCovariance.h new file mode 100644 index 000000000..e49459fea --- /dev/null +++ b/src/stats/inc/GaussianLikelihoodScalarCovariance.h @@ -0,0 +1,71 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LIKELIHOOD_SCALAR_COV_H +#define UQ_GAUSSIAN_LIKELIHOOD_SCALAR_COV_H + +#include + +namespace QUESO { + +/*! + * \file GaussianLikelihoodScalarCovariance.h + * + * \class GaussianLikelihoodScalarCovariance + * \brief A class that represents a Gaussian likelihood with scalar covariance + */ + +template +class GaussianLikelihoodScalarCovariance : public BaseGaussianLikelihood { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * Instantiates a Gaussian likelihood function, given a prefix, its domain, + * a set of observations and a scalar variance + */ + GaussianLikelihoodScalarCovariance(const char * prefix, + const VectorSet & domainSet, const double * observations, + double variance); + + //! Destructor + virtual ~GaussianLikelihoodScalarCovariance(); + //@} + + //! Actual value of the scalar function. + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + + //! Logarithm of the value of the scalar function. + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + +private: + double m_variance; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LIKELIHOOD_SCALAR_COV_H diff --git a/src/stats/src/GaussianLikelihood.C b/src/stats/src/GaussianLikelihood.C new file mode 100644 index 000000000..7cbb2ab1d --- /dev/null +++ b/src/stats/src/GaussianLikelihood.C @@ -0,0 +1,48 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include + +namespace QUESO { + +template +BaseGaussianLikelihood::BaseGaussianLikelihood( + const char * prefix, const VectorSet & domainSet, + const double * observations) + : BaseScalarFunction(prefix, domainSet), + m_observations(observations) +{ +} + +template +BaseGaussianLikelihood::~BaseGaussianLikelihood() +{ +} + +} // End namespace QUESO + +template class QUESO::BaseGaussianLikelihood; diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C new file mode 100644 index 000000000..846834e35 --- /dev/null +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -0,0 +1,74 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include + +namespace QUESO { + +template +GaussianLikelihoodScalarCovariance::GaussianLikelihoodScalarCovariance( + const char * prefix, const VectorSet & domainSet, + const double * observations, double variance) + : BaseGaussianLikelihood(prefix, domainSet, observations), + m_variance(variance) +{ +} + +template +GaussianLikelihoodScalarCovariance::~GaussianLikelihoodScalarCovariance() +{ +} + +template +double +GaussianLikelihoodScalarCovariance::actualValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); +} + +template +double +GaussianLikelihoodScalarCovariance::lnValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + double misfit = 0.0; + unsigned int obsLength = 10; // FIXME: this is wrong + + for (unsigned int i = 0; i < obsLength; i++) { + misfit += this->m_modelOutput[i] - this->m_observations[i]; + } + + return -0.5 * misfit * misfit / m_variance; +} + +} // End namespace QUESO + +template class QUESO::GaussianLikelihoodScalarCovariance; From 210c1c49dc886d97a60282dc263169d0a24d6e87 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Wed, 21 Jan 2015 22:22:41 -0600 Subject: [PATCH 25/99] Remove trailing whitespace --- src/Makefile.am | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 711babf34..aacfe62e1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,12 +9,12 @@ if GRVY_ENABLED AM_CPPFLAGS += $(GRVY_CFLAGS) endif -if GLPK_ENABLED +if GLPK_ENABLED AM_CPPFLAGS += $(GLPK_CFLAGS) endif -if HDF5_ENABLED - AM_CPPFLAGS += $(HDF5_CFLAGS) +if HDF5_ENABLED + AM_CPPFLAGS += $(HDF5_CFLAGS) endif if LIBMESH_ENABLED @@ -31,16 +31,16 @@ endif lib_LTLIBRARIES = libqueso.la libqueso_includedir = $(prefix)/include/queso libqueso_la_LDFLAGS = $(all_libraries) -release $(GENERIC_RELEASE) -libqueso_la_LDFLAGS += $(GSL_LIBS) +libqueso_la_LDFLAGS += $(GSL_LIBS) libqueso_la_LDFLAGS += $(BOOST_PROGRAM_OPTIONS_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIBS) libqueso_la_LDFLAGS += $(ANN_LIBS) libqueso_la_LDFLAGS += $(HDF5_LIBS) $(HDF5_CXXLIBS) -if GRVY_ENABLED +if GRVY_ENABLED libqueso_la_LDFLAGS += $(GRVY_LIBS) endif -if GLPK_ENABLED +if GLPK_ENABLED libqueso_la_LDFLAGS += $(GLPK_LIBS) endif @@ -94,7 +94,7 @@ libqueso_la_SOURCES += core/src/InfiniteDimensionalLikelihoodBase.C libqueso_la_SOURCES += core/src/FunctionOperatorBuilder.C -# Sources from core/src with gsl conditional +# Sources from core/src with gsl conditional if UQBT_GSL libqueso_la_SOURCES += core/src/GslVector.C @@ -340,7 +340,7 @@ libqueso_include_HEADERS += basic/inc/IntersectionSubset.h libqueso_include_HEADERS += basic/inc/GenericVectorFunction.h libqueso_include_HEADERS += basic/inc/ConstantVectorFunction.h -# Headers to install from stats/inc +# Headers to install from stats/inc libqueso_include_HEADERS += stats/inc/FiniteDistribution.h libqueso_include_HEADERS += stats/inc/JointPdf.h @@ -423,7 +423,7 @@ libqueso_include_HEADERS += stats/inc/VectorGaussianRandomField.h libqueso_include_HEADERS += stats/inc/GaussianLikelihood.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h -# Headers to install from gp/inc +# Headers to install from gp/inc libqueso_include_HEADERS += gp/inc/ExperimentModel.h libqueso_include_HEADERS += gp/inc/ExperimentModelOptions.h From 23b02cd4abb1b2dc0007ac7057b83a4711a2c35e Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 22 Jan 2015 12:41:56 -0600 Subject: [PATCH 26/99] Make obs vector an std::vector --- src/stats/inc/GaussianLikelihood.h | 8 +++++--- src/stats/inc/GaussianLikelihoodScalarCovariance.h | 4 ++-- src/stats/src/GaussianLikelihood.C | 2 +- src/stats/src/GaussianLikelihoodScalarCovariance.C | 5 ++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h index 7c63333e6..ed4f807ab 100644 --- a/src/stats/inc/GaussianLikelihood.h +++ b/src/stats/inc/GaussianLikelihood.h @@ -25,6 +25,7 @@ #ifndef UQ_GAUSSIAN_LLHD_H #define UQ_GAUSSIAN_LLHD_H +#include #include namespace QUESO { @@ -51,7 +52,8 @@ class BaseGaussianLikelihood : public BaseScalarFunction { * evaluating the likelihood functional */ BaseGaussianLikelihood(const char * prefix, - const VectorSet & domainSet, const double * observations); + const VectorSet & domainSet, + const std::vector & observations); //! Destructor virtual ~BaseGaussianLikelihood(); @@ -69,9 +71,9 @@ class BaseGaussianLikelihood : public BaseScalarFunction { const V * domainDirection, V * gradVector, M * hessianMatrix, V * hessianEffect) const = 0; -//protected: +protected: double * m_modelOutput; - const double * m_observations; + const std::vector & m_observations; }; } // End namespace QUESO diff --git a/src/stats/inc/GaussianLikelihoodScalarCovariance.h b/src/stats/inc/GaussianLikelihoodScalarCovariance.h index e49459fea..055c1e481 100644 --- a/src/stats/inc/GaussianLikelihoodScalarCovariance.h +++ b/src/stats/inc/GaussianLikelihoodScalarCovariance.h @@ -47,8 +47,8 @@ class GaussianLikelihoodScalarCovariance : public BaseGaussianLikelihood { * a set of observations and a scalar variance */ GaussianLikelihoodScalarCovariance(const char * prefix, - const VectorSet & domainSet, const double * observations, - double variance); + const VectorSet & domainSet, + const std::vector & observations, double variance); //! Destructor virtual ~GaussianLikelihoodScalarCovariance(); diff --git a/src/stats/src/GaussianLikelihood.C b/src/stats/src/GaussianLikelihood.C index 7cbb2ab1d..c602e3527 100644 --- a/src/stats/src/GaussianLikelihood.C +++ b/src/stats/src/GaussianLikelihood.C @@ -32,7 +32,7 @@ namespace QUESO { template BaseGaussianLikelihood::BaseGaussianLikelihood( const char * prefix, const VectorSet & domainSet, - const double * observations) + const std::vector & observations) : BaseScalarFunction(prefix, domainSet), m_observations(observations) { diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C index 846834e35..f17f29322 100644 --- a/src/stats/src/GaussianLikelihoodScalarCovariance.C +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -32,7 +32,7 @@ namespace QUESO { template GaussianLikelihoodScalarCovariance::GaussianLikelihoodScalarCovariance( const char * prefix, const VectorSet & domainSet, - const double * observations, double variance) + const std::vector & observations, double variance) : BaseGaussianLikelihood(prefix, domainSet, observations), m_variance(variance) { @@ -60,9 +60,8 @@ GaussianLikelihoodScalarCovariance::lnValue(const V & domainVector, V * hessianEffect) const { double misfit = 0.0; - unsigned int obsLength = 10; // FIXME: this is wrong - for (unsigned int i = 0; i < obsLength; i++) { + for (unsigned int i = 0; i < this->m_observations.size(); i++) { misfit += this->m_modelOutput[i] - this->m_observations[i]; } From 5731aacb21574fb9f2fb7e8911117c0544c1a965 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 22 Jan 2015 12:47:41 -0600 Subject: [PATCH 27/99] Make model output vector a std::vector --- src/stats/inc/GaussianLikelihood.h | 2 +- src/stats/src/GaussianLikelihood.C | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h index ed4f807ab..9a8484b22 100644 --- a/src/stats/inc/GaussianLikelihood.h +++ b/src/stats/inc/GaussianLikelihood.h @@ -72,7 +72,7 @@ class BaseGaussianLikelihood : public BaseScalarFunction { V * hessianEffect) const = 0; protected: - double * m_modelOutput; + std::vector m_modelOutput; const std::vector & m_observations; }; diff --git a/src/stats/src/GaussianLikelihood.C b/src/stats/src/GaussianLikelihood.C index c602e3527..862eae05c 100644 --- a/src/stats/src/GaussianLikelihood.C +++ b/src/stats/src/GaussianLikelihood.C @@ -34,6 +34,7 @@ BaseGaussianLikelihood::BaseGaussianLikelihood( const char * prefix, const VectorSet & domainSet, const std::vector & observations) : BaseScalarFunction(prefix, domainSet), + m_modelOutput(observations.size()), m_observations(observations) { } From 7c14ee8dde90e56fe50e48d2765b6bddb98f8d96 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 22 Jan 2015 12:48:27 -0600 Subject: [PATCH 28/99] Fix bug in computation of L2 norm of misfit --- src/stats/src/GaussianLikelihoodScalarCovariance.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C index f17f29322..c18e25e1c 100644 --- a/src/stats/src/GaussianLikelihoodScalarCovariance.C +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -62,10 +62,11 @@ GaussianLikelihoodScalarCovariance::lnValue(const V & domainVector, double misfit = 0.0; for (unsigned int i = 0; i < this->m_observations.size(); i++) { - misfit += this->m_modelOutput[i] - this->m_observations[i]; + double diff = this->m_modelOutput[i] - this->m_observations[i]; + misfit += diff * diff; } - return -0.5 * misfit * misfit / m_variance; + return -0.5 * misfit / m_variance; } } // End namespace QUESO From 869a832dc90d3c0e924270aa575fdcae1b891ed2 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 22 Jan 2015 16:24:38 -0600 Subject: [PATCH 29/99] Make evaluateModel return a vector of observations --- src/stats/inc/GaussianLikelihood.h | 3 +-- src/stats/src/GaussianLikelihood.C | 1 - src/stats/src/GaussianLikelihoodScalarCovariance.C | 5 ++++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h index 9a8484b22..3c348b90c 100644 --- a/src/stats/inc/GaussianLikelihood.h +++ b/src/stats/inc/GaussianLikelihood.h @@ -67,12 +67,11 @@ class BaseGaussianLikelihood : public BaseScalarFunction { * synthetic observations that will be to compare to actual observations when * computing the likelihood functional. */ - virtual double * evaluateModel(const V & domainVector, + virtual const std::vector & evaluateModel(const V & domainVector, const V * domainDirection, V * gradVector, M * hessianMatrix, V * hessianEffect) const = 0; protected: - std::vector m_modelOutput; const std::vector & m_observations; }; diff --git a/src/stats/src/GaussianLikelihood.C b/src/stats/src/GaussianLikelihood.C index 862eae05c..c602e3527 100644 --- a/src/stats/src/GaussianLikelihood.C +++ b/src/stats/src/GaussianLikelihood.C @@ -34,7 +34,6 @@ BaseGaussianLikelihood::BaseGaussianLikelihood( const char * prefix, const VectorSet & domainSet, const std::vector & observations) : BaseScalarFunction(prefix, domainSet), - m_modelOutput(observations.size()), m_observations(observations) { } diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C index c18e25e1c..8f44c6aee 100644 --- a/src/stats/src/GaussianLikelihoodScalarCovariance.C +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -61,8 +61,11 @@ GaussianLikelihoodScalarCovariance::lnValue(const V & domainVector, { double misfit = 0.0; + const std::vector & modelOutput = this->evaluateModel(domainVector, + domainDirection, gradVector, hessianMatrix, hessianEffect); + for (unsigned int i = 0; i < this->m_observations.size(); i++) { - double diff = this->m_modelOutput[i] - this->m_observations[i]; + double diff = modelOutput[i] - this->m_observations[i]; misfit += diff * diff; } From 8d9642dc0358ebde6a3a566573186ee984f6f7e5 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 22 Jan 2015 16:25:02 -0600 Subject: [PATCH 30/99] Adding example scalar likelihood code --- examples/Makefile.am | 10 ++ .../gaussian_likelihoods/scalarCovariance.C | 117 ++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 examples/gaussian_likelihoods/scalarCovariance.C diff --git a/examples/Makefile.am b/examples/Makefile.am index 03b928cba..f6ee241bd 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -367,6 +367,16 @@ gpmsa_scalar_SOURCES = gp/scalar/gpmsa_scalar.C gpmsa_scalar_LDADD = $(top_builddir)/src/libqueso.la gpmsa_scalar_CPPFLAGS = -I$(top_srcdir)/examples/gp/scalar $(QUESO_CPPFLAGS) +####################################### +# Canned Gaussian likelihood examples # +####################################### +scalarCovariancedir = $(prefix)/examples/gaussian_likelihoods + +scalarCovariance_PROGRAMS = scalarCovariance +scalarCovariance_SOURCES = gaussian_likelihoods/scalarCovariance.C +scalarCovariance_LDADD = $(top_builddir)/src/libqueso.la +scalarCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/scalarCovariance $(QUESO_CPPFLAGS) + dist_gpmsa_scalar_DATA = dist_gpmsa_scalar_DATA += ${gpmsa_scalar_SOURCES} diff --git a/examples/gaussian_likelihoods/scalarCovariance.C b/examples/gaussian_likelihoods/scalarCovariance.C new file mode 100644 index 000000000..56f81aa24 --- /dev/null +++ b/examples/gaussian_likelihoods/scalarCovariance.C @@ -0,0 +1,117 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include +#include +#include + +template +class Likelihood : public QUESO::GaussianLikelihoodScalarCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const std::vector & observations, double variance) + : QUESO::GaussianLikelihoodScalarCovariance(prefix, domain, + observations, variance), + m_modelOutput(observations.size()) + { + } + + virtual ~Likelihood() + { + } + + virtual const std::vector & evaluateModel(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < this->m_modelOutput.size(); i++) { + this->m_modelOutput[i] = 1.0; + } + + return this->m_modelOutput; + } + +private: + mutable std::vector m_modelOutput; +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, argv[1], "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = 0.0; + double max_val = 1.0; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + + std::vector observations(2); + observations[0] = 1.0; + observations[1] = 1.0; + Likelihood lhood("llhd_", paramDomain, + observations, 1.0); + + QUESO::GenericVectorRV + postRv("post_", paramSpace); + + QUESO::StatisticalInverseProblem + ip("", NULL, priorRv, lhood, postRv); + + QUESO::GslVector paramInitials(paramSpace.zeroVector()); + + paramInitials[0] = 0.0; + + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); + + for (unsigned int i = 0; i < 1; i++) { + proposalCovMatrix(i, i) = 0.1; + } + + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); + + MPI_Finalize(); + + return 0; +} + From 8c2c3240a5a4a2664ff35c030afd19123872817b Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 23 Jan 2015 12:05:51 -0600 Subject: [PATCH 31/99] Update observation handling to use GslVector In particular, this updates the implementation of lnValue to use some of the baked methods in GslVector to make computation of the misfit and the norm cleaner. This will also be beneficial when it comes to implementing the case for full observation error covariance matrix, since then we can use the canned methods that solve linear systems. --- .../gaussian_likelihoods/scalarCovariance.C | 27 ++++++++++--------- src/stats/inc/GaussianLikelihood.h | 8 +++--- .../inc/GaussianLikelihoodScalarCovariance.h | 4 +-- src/stats/src/GaussianLikelihood.C | 2 +- .../src/GaussianLikelihoodScalarCovariance.C | 16 +++++------ 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/examples/gaussian_likelihoods/scalarCovariance.C b/examples/gaussian_likelihoods/scalarCovariance.C index 56f81aa24..e97c4bcd0 100644 --- a/examples/gaussian_likelihoods/scalarCovariance.C +++ b/examples/gaussian_likelihoods/scalarCovariance.C @@ -37,10 +37,9 @@ class Likelihood : public QUESO::GaussianLikelihoodScalarCovariance public: Likelihood(const char * prefix, const QUESO::VectorSet & domain, - const std::vector & observations, double variance) + const V & observations, double variance) : QUESO::GaussianLikelihoodScalarCovariance(prefix, domain, - observations, variance), - m_modelOutput(observations.size()) + observations, variance) { } @@ -48,20 +47,15 @@ public: { } - virtual const std::vector & evaluateModel(const V & domainVector, - const V * domainDirection, V * gradVector, M * hessianMatrix, + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, V * hessianEffect) const { // Evaluate model and fill up the m_modelOutput member variable - for (unsigned int i = 0; i < this->m_modelOutput.size(); i++) { - this->m_modelOutput[i] = 1.0; + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = 1.0; } - - return this->m_modelOutput; } - -private: - mutable std::vector m_modelOutput; }; int main(int argc, char ** argv) { @@ -86,9 +80,16 @@ int main(int argc, char ** argv) { QUESO::UniformVectorRV priorRv("prior_", paramDomain); - std::vector observations(2); + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); observations[0] = 1.0; observations[1] = 1.0; + + // Pass in observations to Gaussian likelihood object Likelihood lhood("llhd_", paramDomain, observations, 1.0); diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h index 3c348b90c..8fe540384 100644 --- a/src/stats/inc/GaussianLikelihood.h +++ b/src/stats/inc/GaussianLikelihood.h @@ -53,7 +53,7 @@ class BaseGaussianLikelihood : public BaseScalarFunction { */ BaseGaussianLikelihood(const char * prefix, const VectorSet & domainSet, - const std::vector & observations); + const V & observations); //! Destructor virtual ~BaseGaussianLikelihood(); @@ -67,12 +67,12 @@ class BaseGaussianLikelihood : public BaseScalarFunction { * synthetic observations that will be to compare to actual observations when * computing the likelihood functional. */ - virtual const std::vector & evaluateModel(const V & domainVector, - const V * domainDirection, V * gradVector, M * hessianMatrix, + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, V * hessianEffect) const = 0; protected: - const std::vector & m_observations; + const V & m_observations; }; } // End namespace QUESO diff --git a/src/stats/inc/GaussianLikelihoodScalarCovariance.h b/src/stats/inc/GaussianLikelihoodScalarCovariance.h index 055c1e481..84032f162 100644 --- a/src/stats/inc/GaussianLikelihoodScalarCovariance.h +++ b/src/stats/inc/GaussianLikelihoodScalarCovariance.h @@ -47,8 +47,8 @@ class GaussianLikelihoodScalarCovariance : public BaseGaussianLikelihood { * a set of observations and a scalar variance */ GaussianLikelihoodScalarCovariance(const char * prefix, - const VectorSet & domainSet, - const std::vector & observations, double variance); + const VectorSet & domainSet, const V & observations, + double variance); //! Destructor virtual ~GaussianLikelihoodScalarCovariance(); diff --git a/src/stats/src/GaussianLikelihood.C b/src/stats/src/GaussianLikelihood.C index c602e3527..a37d458b5 100644 --- a/src/stats/src/GaussianLikelihood.C +++ b/src/stats/src/GaussianLikelihood.C @@ -32,7 +32,7 @@ namespace QUESO { template BaseGaussianLikelihood::BaseGaussianLikelihood( const char * prefix, const VectorSet & domainSet, - const std::vector & observations) + const V & observations) : BaseScalarFunction(prefix, domainSet), m_observations(observations) { diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C index 8f44c6aee..70910002c 100644 --- a/src/stats/src/GaussianLikelihoodScalarCovariance.C +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -32,7 +32,7 @@ namespace QUESO { template GaussianLikelihoodScalarCovariance::GaussianLikelihoodScalarCovariance( const char * prefix, const VectorSet & domainSet, - const std::vector & observations, double variance) + const V & observations, double variance) : BaseGaussianLikelihood(prefix, domainSet, observations), m_variance(variance) { @@ -59,17 +59,15 @@ GaussianLikelihoodScalarCovariance::lnValue(const V & domainVector, const V * domainDirection, V * gradVector, M * hessianMatrix, V * hessianEffect) const { - double misfit = 0.0; + V modelOutput(this->m_observations, 0, 0); // At least it's not a copy - const std::vector & modelOutput = this->evaluateModel(domainVector, - domainDirection, gradVector, hessianMatrix, hessianEffect); + this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector, + hessianMatrix, hessianEffect); - for (unsigned int i = 0; i < this->m_observations.size(); i++) { - double diff = modelOutput[i] - this->m_observations[i]; - misfit += diff * diff; - } + modelOutput -= this->m_observations; // Compute misfit + double norm2_squared = modelOutput.norm2Sq(); // Compute square of 2-norm - return -0.5 * misfit / m_variance; + return -0.5 * norm2_squared / m_variance; } } // End namespace QUESO From d292ff2c2e23fd5abf62f78dad294e6ed10c42b0 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Sat, 24 Jan 2015 11:22:22 -0600 Subject: [PATCH 32/99] variance -> covariance notation change --- src/stats/inc/GaussianLikelihoodScalarCovariance.h | 6 +++--- src/stats/src/GaussianLikelihoodScalarCovariance.C | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stats/inc/GaussianLikelihoodScalarCovariance.h b/src/stats/inc/GaussianLikelihoodScalarCovariance.h index 84032f162..aa3bc4150 100644 --- a/src/stats/inc/GaussianLikelihoodScalarCovariance.h +++ b/src/stats/inc/GaussianLikelihoodScalarCovariance.h @@ -44,11 +44,11 @@ class GaussianLikelihoodScalarCovariance : public BaseGaussianLikelihood { //! Default constructor. /*! * Instantiates a Gaussian likelihood function, given a prefix, its domain, - * a set of observations and a scalar variance + * a set of observations and a scalar covariance matrix. */ GaussianLikelihoodScalarCovariance(const char * prefix, const VectorSet & domainSet, const V & observations, - double variance); + double covariance); //! Destructor virtual ~GaussianLikelihoodScalarCovariance(); @@ -63,7 +63,7 @@ class GaussianLikelihoodScalarCovariance : public BaseGaussianLikelihood { V * gradVector, M * hessianMatrix, V * hessianEffect) const; private: - double m_variance; + double m_covariance; }; } // End namespace QUESO diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C index 70910002c..e44679385 100644 --- a/src/stats/src/GaussianLikelihoodScalarCovariance.C +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -32,9 +32,9 @@ namespace QUESO { template GaussianLikelihoodScalarCovariance::GaussianLikelihoodScalarCovariance( const char * prefix, const VectorSet & domainSet, - const V & observations, double variance) + const V & observations, double covariance) : BaseGaussianLikelihood(prefix, domainSet, observations), - m_variance(variance) + m_covariance(covariance) { } @@ -67,7 +67,7 @@ GaussianLikelihoodScalarCovariance::lnValue(const V & domainVector, modelOutput -= this->m_observations; // Compute misfit double norm2_squared = modelOutput.norm2Sq(); // Compute square of 2-norm - return -0.5 * norm2_squared / m_variance; + return -0.5 * norm2_squared / m_covariance; } } // End namespace QUESO From 40d3ded55fde56ec63c2c359acdbf6df08ecb205 Mon Sep 17 00:00:00 2001 From: Teresa Portone Date: Mon, 9 Feb 2015 10:36:25 -0600 Subject: [PATCH 33/99] Corrected the documentation of GslVector::norm2Sq to match its behavior. --- src/core/inc/GslVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/inc/GslVector.h b/src/core/inc/GslVector.h index 8c569fa3d..869987cbb 100644 --- a/src/core/inc/GslVector.h +++ b/src/core/inc/GslVector.h @@ -115,7 +115,7 @@ class GslVector : public Vector //! @name Mathematical methods. //@{ - //! Returns the norm of the vector, as the square root of 2-norm of this vector. + //! Returns the 2-norm squared of this vector. double norm2Sq () const; //! Returns the 2-norm (Euclidean norm) of the vector. From 3292789b35de5646d262062eba67dc833096628c Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Sat, 24 Jan 2015 11:22:55 -0600 Subject: [PATCH 34/99] Adding diagonal covariance canned Gaussian likelihood --- .../GaussianLikelihoodDiagonalCovariance.h | 72 +++++++++++++++++ .../GaussianLikelihoodDiagonalCovariance.C | 81 +++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 src/stats/inc/GaussianLikelihoodDiagonalCovariance.h create mode 100644 src/stats/src/GaussianLikelihoodDiagonalCovariance.C diff --git a/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h b/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h new file mode 100644 index 000000000..50c4e3516 --- /dev/null +++ b/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h @@ -0,0 +1,72 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LIKELIHOOD_DIAG_COV_H +#define UQ_GAUSSIAN_LIKELIHOOD_DIAG_COV_H + +#include + +namespace QUESO { + +/*! + * \file GaussianLikelihoodDiagonalCovariance.h + * + * \class GaussianLikelihoodDiagonalCovariance + * \brief A class that represents a Gaussian likelihood with scalar covariance + */ + +template +class GaussianLikelihoodDiagonalCovariance : public BaseGaussianLikelihood { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * Instantiates a Gaussian likelihood function, given a prefix, its domain, + * a set of observations and a diagonal covariance matrix. The diagonal + * covariance matrix is stored as a vector in the \c covariance parameter. + */ + GaussianLikelihoodDiagonalCovariance(const char * prefix, + const VectorSet & domainSet, const V & observations, + const V & covariance); + + //! Destructor + virtual ~GaussianLikelihoodDiagonalCovariance(); + //@} + + //! Actual value of the scalar function. + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + + //! Logarithm of the value of the scalar function. + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + +private: + const V & m_covariance; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LIKELIHOOD_DIAG_COV_H diff --git a/src/stats/src/GaussianLikelihoodDiagonalCovariance.C b/src/stats/src/GaussianLikelihoodDiagonalCovariance.C new file mode 100644 index 000000000..df957baf2 --- /dev/null +++ b/src/stats/src/GaussianLikelihoodDiagonalCovariance.C @@ -0,0 +1,81 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include + +namespace QUESO { + +template +GaussianLikelihoodDiagonalCovariance::GaussianLikelihoodDiagonalCovariance( + const char * prefix, const VectorSet & domainSet, + const V & observations, const V & covariance) + : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covariance(covariance) +{ + if (covariance.sizeLocal() != observations.sizeLocal()) { + queso_error_msg("Covariance matrix not same size as observation vector"); + } +} + +template +GaussianLikelihoodDiagonalCovariance::~GaussianLikelihoodDiagonalCovariance() +{ +} + +template +double +GaussianLikelihoodDiagonalCovariance::actualValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); +} + +template +double +GaussianLikelihoodDiagonalCovariance::lnValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + V modelOutput(this->m_observations, 0, 0); // At least it's not a copy + + this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector, + hessianMatrix, hessianEffect); + + modelOutput -= this->m_observations; // Compute misfit + modelOutput *= modelOutput; + modelOutput /= this->m_covariance; // Multiply by inverse covriance matrix + + double norm2_squared = modelOutput.sumOfComponents(); // This is square of 2-norm + + return -0.5 * norm2_squared; +} + +} // End namespace QUESO + +template class QUESO::GaussianLikelihoodDiagonalCovariance; From 2c843204bd8212e3987e22e76904289ae7594e41 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 26 Jan 2015 09:50:30 -0600 Subject: [PATCH 35/99] Add Gaussian likelihood with diag cov to build Also adding an example --- examples/Makefile.am | 7 +- .../gaussian_likelihoods/diagonalCovariance.C | 123 ++++++++++++++++++ inc/queso/Makefile.am | 3 + src/Makefile.am | 2 + 4 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 examples/gaussian_likelihoods/diagonalCovariance.C diff --git a/examples/Makefile.am b/examples/Makefile.am index f6ee241bd..8b3f18967 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -371,12 +371,17 @@ gpmsa_scalar_CPPFLAGS = -I$(top_srcdir)/examples/gp/scalar $(QUESO_CPPFLAGS) # Canned Gaussian likelihood examples # ####################################### scalarCovariancedir = $(prefix)/examples/gaussian_likelihoods - scalarCovariance_PROGRAMS = scalarCovariance scalarCovariance_SOURCES = gaussian_likelihoods/scalarCovariance.C scalarCovariance_LDADD = $(top_builddir)/src/libqueso.la scalarCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/scalarCovariance $(QUESO_CPPFLAGS) +diagonalCovariancedir = $(prefix)/examples/gaussian_likelihoods +diagonalCovariance_PROGRAMS = diagonalCovariance +diagonalCovariance_SOURCES = gaussian_likelihoods/diagonalCovariance.C +diagonalCovariance_LDADD = $(top_builddir)/src/libqueso.la +diagonalCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/diagonalCovariance $(QUESO_CPPFLAGS) + dist_gpmsa_scalar_DATA = dist_gpmsa_scalar_DATA += ${gpmsa_scalar_SOURCES} diff --git a/examples/gaussian_likelihoods/diagonalCovariance.C b/examples/gaussian_likelihoods/diagonalCovariance.C new file mode 100644 index 000000000..af27f2ee1 --- /dev/null +++ b/examples/gaussian_likelihoods/diagonalCovariance.C @@ -0,0 +1,123 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include +#include +#include + +template +class Likelihood : public QUESO::GaussianLikelihoodDiagonalCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const V & covariance) + : QUESO::GaussianLikelihoodDiagonalCovariance(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = 1.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, argv[1], "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = 0.0; + double max_val = 1.0; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + + // Fill up covariance 'matrix' + QUESO::GslVector covariance(obsSpace.zeroVector()); + covariance[0] = 1.0; + covariance[1] = 1.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + QUESO::GenericVectorRV + postRv("post_", paramSpace); + + QUESO::StatisticalInverseProblem + ip("", NULL, priorRv, lhood, postRv); + + QUESO::GslVector paramInitials(paramSpace.zeroVector()); + + paramInitials[0] = 0.0; + + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); + + for (unsigned int i = 0; i < 1; i++) { + proposalCovMatrix(i, i) = 0.1; + } + + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); + + MPI_Finalize(); + + return 0; +} + diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index 7b9541934..c6c70f39a 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -106,6 +106,7 @@ BUILT_SOURCES += GammaVectorRV.h BUILT_SOURCES += GammaVectorRealizer.h BUILT_SOURCES += GaussianJointPdf.h BUILT_SOURCES += GaussianLikelihood.h +BUILT_SOURCES += GaussianLikelihoodDiagonalCovariance.h BUILT_SOURCES += GaussianLikelihoodScalarCovariance.h BUILT_SOURCES += GaussianVectorCdf.h BUILT_SOURCES += GaussianVectorMdf.h @@ -378,6 +379,8 @@ GaussianJointPdf.h: $(top_srcdir)/src/stats/inc/GaussianJointPdf.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihood.h: $(top_srcdir)/src/stats/inc/GaussianLikelihood.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihoodDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodScalarCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodScalarCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianVectorCdf.h: $(top_srcdir)/src/stats/inc/GaussianVectorCdf.h diff --git a/src/Makefile.am b/src/Makefile.am index aacfe62e1..95d6f1f33 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -238,6 +238,7 @@ libqueso_la_SOURCES += stats/src/UniformVectorRV.C libqueso_la_SOURCES += stats/src/WignerVectorRV.C libqueso_la_SOURCES += stats/src/GaussianLikelihood.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodScalarCovariance.C +libqueso_la_SOURCES += stats/src/GaussianLikelihoodDiagonalCovariance.C # Sources from gp/src @@ -422,6 +423,7 @@ libqueso_include_HEADERS += stats/inc/ScalarGaussianRandomField.h libqueso_include_HEADERS += stats/inc/VectorGaussianRandomField.h libqueso_include_HEADERS += stats/inc/GaussianLikelihood.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihoodDiagonalCovariance.h # Headers to install from gp/inc From 2e1f2e8efe4a69a21cc4394a123c38a687269bf0 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 26 Jan 2015 22:47:59 -0600 Subject: [PATCH 36/99] Adding Gaussian llhd with full covariance and eg --- examples/Makefile.am | 6 + .../gaussian_likelihoods/fullCovariance.C | 124 ++++++++++++++++++ inc/queso/Makefile.am | 3 + src/Makefile.am | 2 + .../inc/GaussianLikelihoodFullCovariance.h | 72 ++++++++++ .../src/GaussianLikelihoodFullCovariance.C | 88 +++++++++++++ 6 files changed, 295 insertions(+) create mode 100644 examples/gaussian_likelihoods/fullCovariance.C create mode 100644 src/stats/inc/GaussianLikelihoodFullCovariance.h create mode 100644 src/stats/src/GaussianLikelihoodFullCovariance.C diff --git a/examples/Makefile.am b/examples/Makefile.am index 8b3f18967..c3e427278 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -382,6 +382,12 @@ diagonalCovariance_SOURCES = gaussian_likelihoods/diagonalCovariance.C diagonalCovariance_LDADD = $(top_builddir)/src/libqueso.la diagonalCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/diagonalCovariance $(QUESO_CPPFLAGS) +fullCovariancedir = $(prefix)/examples/gaussian_likelihoods +fullCovariance_PROGRAMS = fullCovariance +fullCovariance_SOURCES = gaussian_likelihoods/fullCovariance.C +fullCovariance_LDADD = $(top_builddir)/src/libqueso.la +fullCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/fullCovariance $(QUESO_CPPFLAGS) + dist_gpmsa_scalar_DATA = dist_gpmsa_scalar_DATA += ${gpmsa_scalar_SOURCES} diff --git a/examples/gaussian_likelihoods/fullCovariance.C b/examples/gaussian_likelihoods/fullCovariance.C new file mode 100644 index 000000000..9ecdf801a --- /dev/null +++ b/examples/gaussian_likelihoods/fullCovariance.C @@ -0,0 +1,124 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include +#include +#include + +template +class Likelihood : public QUESO::GaussianLikelihoodFullCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const M & covariance) + : QUESO::GaussianLikelihoodFullCovariance(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = 1.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, argv[1], "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = 0.0; + double max_val = 1.0; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + + // Fill up covariance 'matrix' + QUESO::GslMatrix covariance(obsSpace.zeroVector()); + covariance(0, 0) = 1.0; + covariance(0, 1) = 0.0; + covariance(1, 0) = 0.0; + covariance(1, 1) = 1.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + QUESO::GenericVectorRV + postRv("post_", paramSpace); + + QUESO::StatisticalInverseProblem + ip("", NULL, priorRv, lhood, postRv); + + QUESO::GslVector paramInitials(paramSpace.zeroVector()); + + paramInitials[0] = 0.0; + + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); + + for (unsigned int i = 0; i < 1; i++) { + proposalCovMatrix(i, i) = 0.1; + } + + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); + + MPI_Finalize(); + + return 0; +} diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index c6c70f39a..dc4cdbf4f 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -107,6 +107,7 @@ BUILT_SOURCES += GammaVectorRealizer.h BUILT_SOURCES += GaussianJointPdf.h BUILT_SOURCES += GaussianLikelihood.h BUILT_SOURCES += GaussianLikelihoodDiagonalCovariance.h +BUILT_SOURCES += GaussianLikelihoodFullCovariance.h BUILT_SOURCES += GaussianLikelihoodScalarCovariance.h BUILT_SOURCES += GaussianVectorCdf.h BUILT_SOURCES += GaussianVectorMdf.h @@ -381,6 +382,8 @@ GaussianLikelihood.h: $(top_srcdir)/src/stats/inc/GaussianLikelihood.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihoodFullCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodFullCovariance.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodScalarCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodScalarCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianVectorCdf.h: $(top_srcdir)/src/stats/inc/GaussianVectorCdf.h diff --git a/src/Makefile.am b/src/Makefile.am index 95d6f1f33..27157b12e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -239,6 +239,7 @@ libqueso_la_SOURCES += stats/src/WignerVectorRV.C libqueso_la_SOURCES += stats/src/GaussianLikelihood.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodScalarCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodDiagonalCovariance.C +libqueso_la_SOURCES += stats/src/GaussianLikelihoodFullCovariance.C # Sources from gp/src @@ -424,6 +425,7 @@ libqueso_include_HEADERS += stats/inc/VectorGaussianRandomField.h libqueso_include_HEADERS += stats/inc/GaussianLikelihood.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodDiagonalCovariance.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihoodFullCovariance.h # Headers to install from gp/inc diff --git a/src/stats/inc/GaussianLikelihoodFullCovariance.h b/src/stats/inc/GaussianLikelihoodFullCovariance.h new file mode 100644 index 000000000..c7867aea1 --- /dev/null +++ b/src/stats/inc/GaussianLikelihoodFullCovariance.h @@ -0,0 +1,72 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LIKELIHOOD_FULL_COV_H +#define UQ_GAUSSIAN_LIKELIHOOD_FULL_COV_H + +#include + +namespace QUESO { + +/*! + * \file GaussianLikelihoodFullCovariance.h + * + * \class GaussianLikelihoodFullCovariance + * \brief A class that represents a Gaussian likelihood with full covariance + */ + +template +class GaussianLikelihoodFullCovariance : public BaseGaussianLikelihood { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * Instantiates a Gaussian likelihood function, given a prefix, its domain, + * a set of observations and a full covariance matrix. The full + * covariance matrix is stored as a matrix in the \c covariance parameter. + */ + GaussianLikelihoodFullCovariance(const char * prefix, + const VectorSet & domainSet, const V & observations, + const M & covariance); + + //! Destructor + virtual ~GaussianLikelihoodFullCovariance(); + //@} + + //! Actual value of the scalar function. + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + + //! Logarithm of the value of the scalar function. + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + +private: + const M & m_covariance; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LIKELIHOOD_FULL_COV_H diff --git a/src/stats/src/GaussianLikelihoodFullCovariance.C b/src/stats/src/GaussianLikelihoodFullCovariance.C new file mode 100644 index 000000000..44d0db591 --- /dev/null +++ b/src/stats/src/GaussianLikelihoodFullCovariance.C @@ -0,0 +1,88 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include + +namespace QUESO { + +template +GaussianLikelihoodFullCovariance::GaussianLikelihoodFullCovariance( + const char * prefix, const VectorSet & domainSet, + const V & observations, const M & covariance) + : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covariance(covariance) +{ + if (covariance.numRowsLocal() != observations.sizeLocal()) { + queso_error_msg("Covariance matrix not same size as observation vector"); + } +} + +template +GaussianLikelihoodFullCovariance::~GaussianLikelihoodFullCovariance() +{ +} + +template +double +GaussianLikelihoodFullCovariance::actualValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); +} + +template +double +GaussianLikelihoodFullCovariance::lnValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + V modelOutput(this->m_observations, 0, 0); // At least it's not a copy + V weightedMisfit(this->m_observations, 0, 0); // At least it's not a copy + + this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector, + hessianMatrix, hessianEffect); + + // Compute misfit G(x) - y + modelOutput -= this->m_observations; + + // Solve \Sigma u = G(x) - y for u + this->m_covariance.invertMultiply(modelOutput, weightedMisfit); + + // Compute (G(x) - y)^T \Sigma^{-1} (G(x) - y) + modelOutput *= weightedMisfit; + + // This is square of 2-norm + double norm2_squared = modelOutput.sumOfComponents(); + + return -0.5 * norm2_squared; +} + +} // End namespace QUESO + +template class QUESO::GaussianLikelihoodFullCovariance; From d99f78177b946c3f0cb2bd92ebd1e4be54d08fef Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 26 Jan 2015 22:52:14 -0600 Subject: [PATCH 37/99] Updating ignores --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 0441836f2..bce58cd09 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,9 @@ examples/outputData examples/template_eg examples/template_example/outputData examples/template_example/template_example +examples/scalarCovariance +examples/diagonalCovariance +examples/fullCovariance src/core/inc/queso.h src/libqueso.la From 4446e86a4273b10fe4b1d6feed5a551591aaf69d Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 30 Jan 2015 09:20:53 -0600 Subject: [PATCH 38/99] Remove trailing whitespace --- src/core/inc/GslMatrix.h | 288 +++++++++++++++++++-------------------- src/core/src/GslMatrix.C | 64 ++++----- 2 files changed, 176 insertions(+), 176 deletions(-) diff --git a/src/core/inc/GslMatrix.h b/src/core/inc/GslMatrix.h index 0967f7646..81e9ae2f2 100644 --- a/src/core/inc/GslMatrix.h +++ b/src/core/inc/GslMatrix.h @@ -38,9 +38,9 @@ namespace QUESO { /*! \class GslMatrix \brief Class for matrix operations using GSL library. - - This class creates and provides basic support for matrices of templated - type as a specialization of Matrix using GSL matrices, which are defined + + This class creates and provides basic support for matrices of templated + type as a specialization of Matrix using GSL matrices, which are defined by an encapsulated gsl_matrix structure. */ @@ -48,153 +48,153 @@ class GslMatrix : public Matrix { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor /*! Creates an empty matrix vector of no dimension. It should not be used by user.*/ GslMatrix(); - - //! Shaped Constructor: creates a shaped matrix with \c numCols columns. + + //! Shaped Constructor: creates a shaped matrix with \c numCols columns. GslMatrix(const BaseEnvironment& env, const Map& map, unsigned int numCols); - - //! Shaped Constructor: creates a square matrix with size \c map.NumGlobalElements() and diagonal values all equal to \c diagValue. + + //! Shaped Constructor: creates a square matrix with size \c map.NumGlobalElements() and diagonal values all equal to \c diagValue. GslMatrix(const BaseEnvironment& env, const Map& map, double diagValue); // MATLAB eye - - //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. + + //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. GslMatrix(const GslVector& v, double diagValue); // MATLAB eye - - //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal(). - /*! The diagonal values of this matrix are the elements in vector \c v. */ + + //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal(). + /*! The diagonal values of this matrix are the elements in vector \c v. */ GslMatrix(const GslVector& v); // MATLAB diag - - //! Shaped Constructor: creates a matrix with \c B.numCols() columns and \c B.numRowsLocal() rows. - /*! \c This matrix is a copy of matrix \c B. */ + + //! Shaped Constructor: creates a matrix with \c B.numCols() columns and \c B.numRowsLocal() rows. + /*! \c This matrix is a copy of matrix \c B. */ GslMatrix(const GslMatrix& B); - + //! Destructor ~GslMatrix(); //@} //! @name Set methods - //@{ - //! Copies values from matrix \c rhs to \c this. + //@{ + //! Copies values from matrix \c rhs to \c this. GslMatrix& operator= (const GslMatrix& rhs); - + //! Stores in \c this the coordinate-wise multiplication of \c this and \c a. GslMatrix& operator*=(double a); - + //! Stores in \c this the coordinate-wise division of \c this by \c a. GslMatrix& operator/=(double a); - + //! Stores in \c this the coordinate-wise addition of \c this and \c rhs. GslMatrix& operator+=(const GslMatrix& rhs); - + //! Stores in \c this the coordinate-wise subtraction of \c this by \c rhs. GslMatrix& operator-=(const GslMatrix& rhs); //@} - - + + //! @name Accessor methods //@{ //! Element access method (non-const). double& operator()(unsigned int i, unsigned int j); - - //! Element access method (const). + + //! Element access method (const). const double& operator()(unsigned int i, unsigned int j) const; - - + + //@} //! @name Attribute methods - //@{ + //@{ //! Returns the local row dimension of \c this matrix. unsigned int numRowsLocal () const; - + //! Returns the global row dimension of \c this matrix. unsigned int numRowsGlobal () const; - + //! Returns the column dimension of \c this matrix. unsigned int numCols () const; - + //! Returns the maximum element value of the matrix. double max () const; - - //! This function returns the number of singular values of \c this matrix (rank). + + //! This function returns the number of singular values of \c this matrix (rank). /*! The rank function provides an estimate of the number of linearly independent rows or columns of a full matrix. */ unsigned int rank (double absoluteZeroThreshold, double relativeZeroThreshold) const; - + //! This function calculated the transpose of \c this matrix (square). GslMatrix transpose () const; - + //! This function calculated the inverse of \c this matrix (square). GslMatrix inverse () const; - - + + //! Calculates the determinant of \c this matrix. double determinant () const; - + //! Calculates the ln(determinant) of \c this matrix. double lnDeterminant () const; - + //@} - + //! @name Norm methods - //@{ + //@{ //! Returns the Frobenius norm of \c this matrix. double normFrob () const; - + //! Returns the Frobenius norm of \c this matrix. double normMax () const; //@} - - - - - + + + + + //! @name Mathematical methods - //@{ + //@{ - //! Computes Cholesky factorization of a real symmetric positive definite matrix \c this. + //! Computes Cholesky factorization of a real symmetric positive definite matrix \c this. /*! In case \this fails to be symmetric and positive definite, an error will be returned. */ int chol (); - -//! Checks for the dimension of \c this matrix, \c matU, \c VecS and \c matVt, and calls the protected routine \c internalSvd to compute the singular values of \c this. + +//! Checks for the dimension of \c this matrix, \c matU, \c VecS and \c matVt, and calls the protected routine \c internalSvd to compute the singular values of \c this. int svd (GslMatrix& matU, GslVector& vecS, GslMatrix& matVt) const; - - //! This function calls private member GslMatrix::internalSvd() to set a M-by-N orthogonal matrix U of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. + + //! This function calls private member GslMatrix::internalSvd() to set a M-by-N orthogonal matrix U of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ const GslMatrix& svdMatU () const; - - //! This function calls private member GslMatrix::internalSvd() to set a N-by-N orthogonal square matrix V of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. + + //! This function calls private member GslMatrix::internalSvd() to set a N-by-N orthogonal square matrix V of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ const GslMatrix& svdMatV () const; - - //! This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solVec, b=rhsVec). + + //! This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solVec, b=rhsVec). int svdSolve (const GslVector& rhsVec, GslVector& solVec) const; - + //! This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solMat, b=rhsMat). - int svdSolve (const GslMatrix& rhsMat, GslMatrix& solMat) const; - + int svdSolve (const GslMatrix& rhsMat, GslMatrix& solMat) const; + //! This function multiplies \c this matrix by vector \c x and returns the resulting vector. GslVector multiply (const GslVector& x) const; - //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. + //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. /*! It calls void GslMatrix::invertMultiply(const GslVector& b, GslVector& x) internally.*/ GslVector invertMultiply (const GslVector& b) const; - + //! This function calculates the inverse of \c this matrix, multiplies it with vector \c b and stores the result in vector \c x. /*! It checks for a previous LU decomposition of \c this matrix and does not recompute it if m_MU != NULL .*/ void invertMultiply (const GslVector& b, GslVector& x) const; - + //! This function calculates the inverse of \c this matrix and multiplies it with matrix \c B. /*! It calls void GslMatrix::invertMultiply(const GslMatrix& B, GslMatrix& X) const internally.*/ GslMatrix invertMultiply (const GslMatrix& B) const; @@ -203,124 +203,124 @@ class GslMatrix : public Matrix /*! It checks for a previous LU decomposition of \c this matrix and does not recompute it if m_MU != NULL .*/ void invertMultiply (const GslMatrix& B, GslMatrix& X) const; - - //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. + + //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. /*! It calls void GslMatrix::InvertMultiplyForceLU(const GslVector& b, GslVector& x) const;(const GslVector& b, GslVector& x) internally.*/ GslVector invertMultiplyForceLU (const GslVector& b) const; - + //! This function calculates the inverse of \c this matrix, multiplies it with vector \c b and stores the result in vector \c x. - /*! It recalculates the LU decomposition of \c this matrix.*/ + /*! It recalculates the LU decomposition of \c this matrix.*/ void invertMultiplyForceLU (const GslVector& b, GslVector& x) const; - + //! This function gets the column_num-th column of \c this matrix and stores it into vector \c column. void getColumn (const unsigned int column_num, GslVector& column) const; - + //! This function gets the column_num-th column of \c this matrix. GslVector getColumn (const unsigned int column_num) const; - - //! This function copies vector \c column into the column_num-th column of \c this matrix. + + //! This function copies vector \c column into the column_num-th column of \c this matrix. void setColumn (const unsigned int column_num, const GslVector& column); - + //! This function gets the row_num-th column of \c this matrix and stores it into vector \c row. void getRow (const unsigned int row_num, GslVector& row) const; - + //! This function gets the row_num-th column of \c this matrix. GslVector getRow (const unsigned int row_num) const; - - //! This function copies vector \c row into the row_num-th column of \c this matrix. + + //! This function copies vector \c row into the row_num-th column of \c this matrix. void setRow (const unsigned int row_num, const GslVector& row); - + //! This function computes the eigenvalues of a real symmetric matrix. void eigen (GslVector& eigenValues, GslMatrix* eigenVectors) const; - + //! This function finds largest eigenvalue, namely \c eigenValue, of \c this matrix and its corresponding eigenvector, namely \c eigenVector. void largestEigen (double& eigenValue, GslVector& eigenVector) const; - + //! This function finds smallest eigenvalue, namely \c eigenValue, of \c this matrix and its corresponding eigenvector, namely \c eigenVector. void smallestEigen (double& eigenValue, GslVector& eigenVector) const; - - //@} - + + //@} + //! @name Get/Set methods - //@{ - + //@{ + //! Component-wise set all values to \c this with value. void cwSet (double value); - + //! Set the components of \c which positions are greater than (rowId,colId) with the value of mat(rowId,colId). void cwSet (unsigned int rowId, unsigned int colId, const GslMatrix& mat); - + void cwExtract (unsigned int rowId, unsigned int colId, GslMatrix& mat) const; - + //! This function sets all the entries bellow the main diagonal of \c this matrix to zero. - /*! If \c includeDiagonal = false, then only the entries bellow the main diagonal are set to zero; + /*! If \c includeDiagonal = false, then only the entries bellow the main diagonal are set to zero; if \c includeDiagonal = true, then the elements of the matrix diagonal are also set to zero.*/ void zeroLower (bool includeDiagonal = false); - + //! This function sets all the entries above the main diagonal of \c this matrix to zero. - /*! If \c includeDiagonal = false, then only the entries above the main diagonal are set to zero; + /*! If \c includeDiagonal = false, then only the entries above the main diagonal are set to zero; if \c includeDiagonal = true, then the elements of the matrix diagonal are also set to zero.*/ void zeroUpper (bool includeDiagonal = false); - + //! This function sets to zero (filters) all entries of \c this matrix which are smaller than \c thresholdValue. /*! If \c thresholdValue < 0 then no values will be filtered.*/ void filterSmallValues (double thresholdValue); - + //! This function sets to zero (filters) all entries of \c this matrix which are greater than \c thresholdValue. - /*! If \c thresholdValue < 0 then no values will be filtered.*/ + /*! If \c thresholdValue < 0 then no values will be filtered.*/ void filterLargeValues (double thresholdValue); - + //! This function stores the transpose of \c this matrix into \c this matrix. void fillWithTranspose (unsigned int rowId, unsigned int colId, const GslMatrix& mat, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - + //! This function fills \c this matrix diagonally with const block matrices. void fillWithBlocksDiagonally (unsigned int rowId, unsigned int colId, const std::vector& matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - + //! This function fills \c this matrix diagonally with block matrices. void fillWithBlocksDiagonally (unsigned int rowId, unsigned int colId, const std::vector< GslMatrix* >& matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - + //! This function fills \c this matrix horizontally with const block matrices. void fillWithBlocksHorizontally(unsigned int rowId, unsigned int colId, const std::vector& matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - - //! This function fills \c this matrix horizontally with const block + + //! This function fills \c this matrix horizontally with const block void fillWithBlocksHorizontally(unsigned int rowId, unsigned int colId, const std::vector< GslMatrix* >& matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - + //! This function fills \c this matrix vertically with const block matrices. void fillWithBlocksVertically (unsigned int rowId, unsigned int colId, const std::vector& matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - + //! This function fills \c this matrix vertically with block matrices. void fillWithBlocksVertically (unsigned int rowId, unsigned int colId, const std::vector< GslMatrix* >& matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - + //! This function calculates the tensor product of matrices \c mat1 and \c mat2 and stores it in \c this matrix. void fillWithTensorProduct (unsigned int rowId, unsigned int colId, @@ -336,33 +336,33 @@ GslVector& x) internally.*/ const GslVector& vec2, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching); - //@} + //@} + - //! @name Miscellaneous methods //@{ - //! Returns \c this matrix. + //! Returns \c this matrix. gsl_matrix* data (); - + void mpiSum (const MpiComm& comm, GslMatrix& M_global) const; - + void matlabLinearInterpExtrap (const GslVector& x1Vec, const GslMatrix& y1Mat, const GslVector& x2Vec); //@} - - - + + + //! @name I/O methods //@{ - - //! Print method. Defines the behavior of the ostream << operator inherited from the Object class. + + //! Print method. Defines the behavior of the ostream << operator inherited from the Object class. void print (std::ostream& os) const; - + //! Write contents of subenvironment in file \c fileName. void subWriteContents (const std::string& varNamePrefix, const std::string& fileName, const std::string& fileType, const std::set& allowedSubEnvIds) const; - + //! Read contents of subenvironment from file \c fileName. void subReadContents (const std::string& fileName, const std::string& fileType, @@ -372,71 +372,71 @@ GslVector& x) internally.*/ private: //! In this function \c this matrix receives a copy of matrix \c src. void copy (const GslMatrix& src); - + //! In this function resets the LU decomposition of \c this matrix, as well as deletes the private member pointers, if existing. void resetLU (); - + //! This function multiplies \c this matrix by vector \c x and stores the resulting vector in \c y. void multiply (const GslVector& x, GslVector& y) const; - + //! This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T for M >= N. On output the matrix A is replaced by U. int internalSvd () const; //! GSL matrix, also referred to as \c this matrix. gsl_matrix* m_mat; - - //! GSL matrix for the LU decomposition of m_mat. + + //! GSL matrix for the LU decomposition of m_mat. mutable gsl_matrix* m_LU; - + //! Inverse matrix of \c this. mutable GslMatrix* m_inverse; - + //! Mapping for matrices involved in the singular value decomposition (svd) routine. mutable Map* m_svdColMap; - + //! m_svdUmat stores the M-by-N orthogonal matrix U after the singular value decomposition of a matrix. - /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an - * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S + /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an + * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S * and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ mutable GslMatrix* m_svdUmat; - + //! m_svdSvec stores the diagonal of the N-by-N diagonal matrix of singular values S after the singular value decomposition of a matrix. - /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an - * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S + /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an + * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S * and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ - + mutable GslVector* m_svdSvec; - + //! m_svdVmat stores the N-by-N orthogonal square matrix V after the singular value decomposition of a matrix. - /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an - * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S + /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an + * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S * and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ mutable GslMatrix* m_svdVmat; - + //! m_svdVmatT stores the transpose of N-by-N orthogonal square matrix V, namely V^T, after the singular value decomposition of a matrix. - /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an - * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S + /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an + * M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S * and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ mutable GslMatrix* m_svdVTmat; - + //! The determinant of \c this matrix. mutable double m_determinant; - + //! The natural logarithm of the determinant of \c this matrix. mutable double m_lnDeterminant; - + //! The permutation matrix of a LU decomposition. - /*! In the LU decomposition PA = LU, the j-th column of the matrix P is given by - * the k-th column of the identity matrix, where k = p_j the j-th element of the permutation vector. + /*! In the LU decomposition PA = LU, the j-th column of the matrix P is given by + * the k-th column of the identity matrix, where k = p_j the j-th element of the permutation vector. * A is the square matrix of interest and P is the permutation matrix. */ mutable gsl_permutation* m_permutation; - + //! m_signum stores the sign of the permutation of the LU decomposition PA = LU. - /*! In the LU decomposition PA = LU, where A is the square matrix of interest - * and P is the permutation matrix, m_signum has the value (-1)^n, + /*! In the LU decomposition PA = LU, where A is the square matrix of interest + * and P is the permutation matrix, m_signum has the value (-1)^n, * where n is the number of interchanges in the permutation.*/ mutable int m_signum; - + //! Indicates whether or not \c this matrix is singular. mutable bool m_isSingular; }; diff --git a/src/core/src/GslMatrix.C b/src/core/src/GslMatrix.C index 37cec723d..b4c29b5fa 100644 --- a/src/core/src/GslMatrix.C +++ b/src/core/src/GslMatrix.C @@ -666,7 +666,7 @@ GslMatrix::internalSvd() const m_svdSvec = new GslVector(m_env,*m_svdColMap); m_svdVmat = new GslMatrix(*m_svdSvec); m_svdVTmat = new GslMatrix(*m_svdSvec); - + //std::cout << "In GslMatrix::internalSvd()" // << ", calling gsl_linalg_SV_decomp_jacobi()..." // << ": nRows = " << nRows @@ -784,11 +784,11 @@ GslMatrix::filterSmallValues(double thresholdValue) if ((aux < 0. ) && (-thresholdValue < aux)) { (*this)(i,j) = 0.; - } + } if ((aux > 0. ) && (thresholdValue > aux)) { (*this)(i,j) = 0.; - } + } } } @@ -807,11 +807,11 @@ GslMatrix::filterLargeValues(double thresholdValue) if ((aux < 0. ) && (-thresholdValue > aux)) { (*this)(i,j) = 0.; - } + } if ((aux > 0. ) && (thresholdValue < aux)) { (*this)(i,j) = 0.; - } + } } } @@ -970,7 +970,7 @@ GslMatrix::fillWithBlocksDiagonally( for (unsigned int colId = 0; colId < nCols; ++colId) { (*this)(initialTargetRowId + cumulativeRowId + rowId, initialTargetColId + cumulativeColId + colId) = (*(matrices[i]))(rowId,colId); } - } + } cumulativeRowId += nRows; cumulativeColId += nCols; } @@ -1191,7 +1191,7 @@ GslMatrix::fillWithTensorProduct( } } } - } + } return; } @@ -1233,7 +1233,7 @@ GslMatrix::fillWithTensorProduct( } } } - } + } return; @@ -1299,7 +1299,7 @@ GslMatrix::determinant() const << ": before 'gsl_linalg_LU_det()'" << std::endl; } - m_determinant = gsl_linalg_LU_det(m_LU,m_signum); + m_determinant = gsl_linalg_LU_det(m_LU,m_signum); if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In GslMatrix::determinant()" << ": after 'gsl_linalg_LU_det()'" @@ -1340,7 +1340,7 @@ GslMatrix::lnDeterminant() const << ": before 'gsl_linalg_LU_det()'" << std::endl; } - m_determinant = gsl_linalg_LU_det(m_LU,m_signum); + m_determinant = gsl_linalg_LU_det(m_LU,m_signum); if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In GslMatrix::lnDeterminant()" << ": after 'gsl_linalg_LU_det()'" @@ -1504,14 +1504,14 @@ GslMatrix::invertMultiply( << ": before 'gsl_linalg_LU_decomp()'" << std::endl; } - iRC = gsl_linalg_LU_decomp(m_LU,m_permutation,&m_signum); + iRC = gsl_linalg_LU_decomp(m_LU,m_permutation,&m_signum); if (iRC != 0) { std::cerr << "In GslMatrix::invertMultiply()" << ", after gsl_linalg_LU_decomp()" << ": iRC = " << iRC << ", gsl error message = " << gsl_strerror(iRC) << std::endl; - } + } gsl_set_error_handler(oldHandler); if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In GslMatrix::invertMultiply()" @@ -1539,7 +1539,7 @@ GslMatrix::invertMultiply( << ": before 'gsl_linalg_LU_solve()'" << std::endl; } - iRC = gsl_linalg_LU_solve(m_LU,m_permutation,b.data(),x.data()); + iRC = gsl_linalg_LU_solve(m_LU,m_permutation,b.data(),x.data()); if (iRC != 0) { m_isSingular = true; std::cerr << "In GslMatrix::invertMultiply()" @@ -1547,7 +1547,7 @@ GslMatrix::invertMultiply( << ": iRC = " << iRC << ", gsl error message = " << gsl_strerror(iRC) << std::endl; - } + } gsl_set_error_handler(oldHandler); if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In GslMatrix::invertMultiply()" @@ -1581,10 +1581,10 @@ GslMatrix::invertMultiply(const GslMatrix& B) const return X; } -void +void GslMatrix::invertMultiply(const GslMatrix& B, GslMatrix& X) const { - + // Sanity Checks UQ_FATAL_RC_MACRO(((B.numRowsLocal() != X.numRowsLocal()) || (B.numCols() != X.numCols() )), @@ -1592,7 +1592,7 @@ GslMatrix::invertMultiply(const GslMatrix& B, GslMatrix& X) const "GslMatrix::invertMultiply()", "Matrices B and X are incompatible"); - + UQ_FATAL_RC_MACRO((this->numRowsLocal() != X.numRowsLocal()), m_env.worldRank(), "GslMatrix::invertMultiply()", @@ -1659,26 +1659,26 @@ GslMatrix::invertMultiplyForceLU( m_env.worldRank(), "GslMatrix::invertMultiplyForceLU()", "gsl_matrix_calloc() failed"); - + iRC = gsl_matrix_memcpy(m_LU, m_mat); UQ_FATAL_RC_MACRO(iRC, m_env.worldRank(), "GslMatrix::invertMultiplyForceLU()", "gsl_matrix_memcpy() failed"); - + if( m_permutation == NULL ) m_permutation = gsl_permutation_calloc(numCols()); UQ_FATAL_TEST_MACRO((m_permutation == NULL), m_env.worldRank(), "GslMatrix::invertMultiplyForceLU()", "gsl_permutation_calloc() failed"); - - iRC = gsl_linalg_LU_decomp(m_LU,m_permutation,&m_signum); + + iRC = gsl_linalg_LU_decomp(m_LU,m_permutation,&m_signum); UQ_FATAL_RC_MACRO(iRC, m_env.worldRank(), "GslMatrix::invertMultiplyForceLU()", "gsl_linalg_LU_decomp() failed"); - iRC = gsl_linalg_LU_solve(m_LU,m_permutation,b.data(),x.data()); + iRC = gsl_linalg_LU_solve(m_LU,m_permutation,b.data(),x.data()); if (iRC != 0) { m_isSingular = true; } @@ -1772,7 +1772,7 @@ GslMatrix::largestEigen(double& eigenValue, GslVector& eigenVector) const // Here we use the norm of the residual as our convergence check: // norm( A*x - \lambda*x ) residual = ( (*this)*z - lambda*z ).norm2(); - + if( residual < tolerance ) { eigenValue = lambda; @@ -1781,7 +1781,7 @@ GslMatrix::largestEigen(double& eigenValue, GslVector& eigenVector) const eigenVector = z; return; } - + } // If we reach this point, then we didn't converge. Print error message @@ -1793,7 +1793,7 @@ GslMatrix::largestEigen(double& eigenValue, GslVector& eigenVector) const "GslMatrix::largestEigen()", "Maximum num iterations exceeded"); - + return; } @@ -1844,13 +1844,13 @@ GslMatrix::smallestEigen(double& eigenValue, GslVector& eigenVector) const one_over_lambda = w[index]; lambda = 1.0/one_over_lambda; - + z = lambda * w; // Here we use the norm of the residual as our convergence check: // norm( A*x - \lambda*x ) residual = ( (*this)*z - lambda*z ).norm2(); - + if( residual < tolerance ) { eigenValue = lambda; @@ -1859,7 +1859,7 @@ GslMatrix::smallestEigen(double& eigenValue, GslVector& eigenVector) const eigenVector = z; return; } - + } // If we reach this point, then we didn't converge. Print error message @@ -1953,7 +1953,7 @@ GslMatrix::getRow(unsigned int row_num ) const GslVector row(m_env, m_map); this->getRow( row_num, row ); - + return row; } @@ -1966,7 +1966,7 @@ GslMatrix::getColumn(unsigned int column_num ) const GslVector column(m_env, m_map); this->getColumn( column_num, column ); - + return column; } @@ -2043,7 +2043,7 @@ GslMatrix::mpiSum( const MpiComm& comm, GslMatrix& M_global ) const for( unsigned int j = 0; j < this->numCols(); j++ ) { k = i + j*M_global.numCols(); - + local[k] = (*this)(i,j); } } @@ -2057,7 +2057,7 @@ GslMatrix::mpiSum( const MpiComm& comm, GslMatrix& M_global ) const for( unsigned int j = 0; j < this->numCols(); j++ ) { k = i + j*M_global.numCols(); - + M_global(i,j) = global[k]; } } From 6e796030044f62a73a7bb4fb3c92d3163b3689ef Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 30 Jan 2015 09:28:12 -0600 Subject: [PATCH 39/99] Adding classes to represent block matrices --- src/core/inc/GslBlockMatrix.h | 89 ++++++++++++++++++++++ src/core/src/GslBlockMatrix.C | 135 ++++++++++++++++++++++++++++++++++ 2 files changed, 224 insertions(+) create mode 100644 src/core/inc/GslBlockMatrix.h create mode 100644 src/core/src/GslBlockMatrix.C diff --git a/src/core/inc/GslBlockMatrix.h b/src/core/inc/GslBlockMatrix.h new file mode 100644 index 000000000..0dc0986eb --- /dev/null +++ b/src/core/inc/GslBlockMatrix.h @@ -0,0 +1,89 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GSL_BLOCK_MATRIX_H +#define UQ_GSL_BLOCK_MATRIX_H + +/*! + * \file GslBlockMatrix.h + * \brief QUESO matrix class using GSL. + */ + +#include + +namespace QUESO { + +/*! + * \class GslBlockMatrix + * \brief Class for matrix operations using GSL library. + * + * This class creates and provides basic support for matrices of templated + * type as a specialization of Matrix using GSL matrices, which are defined + * by an encapsulated gsl_matrix structure. + */ + +class GslBlockMatrix : public Matrix +{ +public: + //! @name Constructor/Destructor methods + //@{ + //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. + GslBlockMatrix(const std::vector & blockSizes, + double diagValue); + + //! Destructor + ~GslBlockMatrix(); + //@} + + //! Return block \c i in the block diagonal matrix + GslBlockMatrix & getBlock(unsigned int i) const; + + //! Return the number of blocks in the block diagonal matrix + unsigned int numBlocks() const; + + //! This function calculates the inverse of \c this matrix, multiplies it with vector \c b and stores the result in vector \c x. + /*! + * It checks for a previous LU decomposition of \c this matrix and does not + * recompute it if m_MU != NULL. + */ + void invertMultiply (const GslVector & b, GslVector & x) const; + + //! @name I/O methods + //@{ + //! Print method. Defines the behavior of operator<< inherited from the Object class. + void print (std::ostream & os) const; + //@} + +private: + + //! Default Constructor + /*! Creates an empty matrix vector of no dimension. It should not be used by user.*/ + GslBlockMatrix(); +}; + +std::ostream & operator<<(std::ostream & os, const GslBlockMatrix & obj); + +} // End namespace QUESO + +#endif // UQ_GSL_BLOCK_MATRIX_H diff --git a/src/core/src/GslBlockMatrix.C b/src/core/src/GslBlockMatrix.C new file mode 100644 index 000000000..d309b62e1 --- /dev/null +++ b/src/core/src/GslBlockMatrix.C @@ -0,0 +1,135 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include + +namespace QUESO { + +GslBlockMatrix::GslBlockMatrix() +{ +} + +GslBlockMatrix::GslBlockMatrix(const std::vector & blockSizes, + double diagValue) + : m_vectorSpaces(blockSizes.size()), + m_blocks(blockSizes.size()) +{ + for (unsigned int i = 0; i < this->m_vectorSpaces.size(); i++) { + this->m_vectorSpaces[i] = new VectorSpace paramSpace( + env, "block_param_", blockSizes[i], NULL); + this->m_blocks[i] = new GslMatrix(this->m_vectorSpaces[i]->zeroVector(), + diagValue); + } +} + +GslBlockMatrix::~GslBlockMatrix() +{ + for (unsigned int i = 0; i < this->m_vectorSpaces.size(); i++) { + delete this->m_blocks[i]; + delete this->m_vectorSpaces[i]; + } +} + +void +GslBlockMatrix::invertMultiply(const GslVector & b, GslVector & x) const +{ + unsigned int totalCols = 0; + + for (unsigned int i = 0; i < this->m_blocks.size(); i++) { + totalCols += this->m_blocks[i].numCols(); + } + + if (this->numCols() != b.sizeLocal()) { + queso_error_msg("block matrix and rhs have incompatible sizes"); + } + + if (x.sizeLocal() != b.sizeLocal()) { + queso_error_msg("solution and rhs have incompatible sizes"); + } + + unsigned int blockOffset = 0; + double totalMisfit = 0.0; + + // Do an invertMultiply for each block + for (unsigned int i = 0; i < this->m_blocks.size(); i++) { + GslVector blockRHS(this->m_vectorSpaces[i].zeroVector()); + GslVector blockSol(this->m_vectorSpaces[i].zeroVector()); + + // Be sure to copy over the RHS to the right sized vector + for (unsigned int j = 0; j < this->m_blocks[i].numCols(); j++) { + blockRHS[j] = b[blockOffset + j]; + } + + // Solve + this->m_block[i].invertMultiply(blockRHS, blockSol); + + // Be sure to copy the block solution back to the global solution vector + for (unsigned int j = 0; j < this->m_blocks[i].numCols(); j++) { + x[blockOffset + j] = blockSol[j]; + } + + // Remember to increment the offset so we don't lose our place for the next + // block + blockOffset += this->m_blocks[i].numCols(); + } +} + +void +GslBlockMatrix::print(std::ostream& os) const +{ + unsigned int nRows = this->numRowsLocal(); + unsigned int nCols = this->numCols(); + + if (m_printHorizontally) { + for (unsigned int i = 0; i < nRows; ++i) { + for (unsigned int j = 0; j < nCols; ++j) { + os << (*this)(i,j) + << " "; + } + if (i != (nRows-1)) os << "; "; + } + //os << std::endl; + } + else { + for (unsigned int i = 0; i < nRows; ++i) { + for (unsigned int j = 0; j < nCols; ++j) { + os << (*this)(i,j) + << " "; + } + os << std::endl; + } + } + + return; +} + +std::ostream& +operator<<(std::ostream& os, const GslBlockMatrix & obj) +{ + obj.print(os); + + return os; +} + +} // End namespace QUESO From a6dfaf1f52cc5021e119b52f26644c78fc9c3ac3 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 30 Jan 2015 17:01:19 -0600 Subject: [PATCH 40/99] Adding Gsl block matrix class --- inc/queso/Makefile.am | 3 ++ src/Makefile.am | 2 + src/core/inc/GslBlockMatrix.h | 23 +++++---- src/core/src/GslBlockMatrix.C | 88 +++++++++++++++++++---------------- 4 files changed, 66 insertions(+), 50 deletions(-) diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index dc4cdbf4f..c4cd532d8 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -36,6 +36,7 @@ BUILT_SOURCES += Environment.h BUILT_SOURCES += EnvironmentOptions.h BUILT_SOURCES += FunctionBase.h BUILT_SOURCES += FunctionOperatorBuilder.h +BUILT_SOURCES += GslBlockMatrix.h BUILT_SOURCES += GslMatrix.h BUILT_SOURCES += GslOptimizer.h BUILT_SOURCES += GslVector.h @@ -240,6 +241,8 @@ FunctionBase.h: $(top_srcdir)/src/core/inc/FunctionBase.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ FunctionOperatorBuilder.h: $(top_srcdir)/src/core/inc/FunctionOperatorBuilder.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GslBlockMatrix.h: $(top_srcdir)/src/core/inc/GslBlockMatrix.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GslMatrix.h: $(top_srcdir)/src/core/inc/GslMatrix.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GslOptimizer.h: $(top_srcdir)/src/core/inc/GslOptimizer.h diff --git a/src/Makefile.am b/src/Makefile.am index 27157b12e..dd78433ac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -92,6 +92,7 @@ libqueso_la_SOURCES += core/src/InfiniteDimensionalMCMCSampler.C libqueso_la_SOURCES += core/src/InfiniteDimensionalMCMCSamplerOptions.C libqueso_la_SOURCES += core/src/InfiniteDimensionalLikelihoodBase.C libqueso_la_SOURCES += core/src/FunctionOperatorBuilder.C +libqueso_la_SOURCES += core/src/GslBlockMatrix.C # Sources from core/src with gsl conditional @@ -302,6 +303,7 @@ libqueso_include_HEADERS += core/inc/InfiniteDimensionalMCMCSampler.h libqueso_include_HEADERS += core/inc/InfiniteDimensionalMCMCSamplerOptions.h libqueso_include_HEADERS += core/inc/InfiniteDimensionalLikelihoodBase.h libqueso_include_HEADERS += core/inc/FunctionOperatorBuilder.h +libqueso_include_HEADERS += core/inc/GslBlockMatrix.h # Headers to install from misc/inc diff --git a/src/core/inc/GslBlockMatrix.h b/src/core/inc/GslBlockMatrix.h index 0dc0986eb..38e3feecf 100644 --- a/src/core/inc/GslBlockMatrix.h +++ b/src/core/inc/GslBlockMatrix.h @@ -30,7 +30,11 @@ * \brief QUESO matrix class using GSL. */ -#include +#include +#include +#include +#include +#include namespace QUESO { @@ -43,21 +47,21 @@ namespace QUESO { * by an encapsulated gsl_matrix structure. */ -class GslBlockMatrix : public Matrix +class GslBlockMatrix { public: //! @name Constructor/Destructor methods //@{ //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. - GslBlockMatrix(const std::vector & blockSizes, - double diagValue); + GslBlockMatrix(const FullEnvironment & env, + const std::vector & blockSizes, double diagValue); //! Destructor ~GslBlockMatrix(); //@} //! Return block \c i in the block diagonal matrix - GslBlockMatrix & getBlock(unsigned int i) const; + GslMatrix & getBlock(unsigned int i) const; //! Return the number of blocks in the block diagonal matrix unsigned int numBlocks() const; @@ -67,7 +71,7 @@ class GslBlockMatrix : public Matrix * It checks for a previous LU decomposition of \c this matrix and does not * recompute it if m_MU != NULL. */ - void invertMultiply (const GslVector & b, GslVector & x) const; + void invertMultiply(const GslVector & b, GslVector & x) const; //! @name I/O methods //@{ @@ -76,10 +80,9 @@ class GslBlockMatrix : public Matrix //@} private: - - //! Default Constructor - /*! Creates an empty matrix vector of no dimension. It should not be used by user.*/ - GslBlockMatrix(); + const FullEnvironment & m_env; + std::vector *> m_vectorSpaces; + std::vector m_blocks; }; std::ostream & operator<<(std::ostream & os, const GslBlockMatrix & obj); diff --git a/src/core/src/GslBlockMatrix.C b/src/core/src/GslBlockMatrix.C index d309b62e1..4dbdac2be 100644 --- a/src/core/src/GslBlockMatrix.C +++ b/src/core/src/GslBlockMatrix.C @@ -26,18 +26,15 @@ namespace QUESO { -GslBlockMatrix::GslBlockMatrix() -{ -} - -GslBlockMatrix::GslBlockMatrix(const std::vector & blockSizes, - double diagValue) - : m_vectorSpaces(blockSizes.size()), +GslBlockMatrix::GslBlockMatrix(const FullEnvironment & env, + const std::vector & blockSizes, double diagValue) + : m_env(env), + m_vectorSpaces(blockSizes.size()), m_blocks(blockSizes.size()) { for (unsigned int i = 0; i < this->m_vectorSpaces.size(); i++) { - this->m_vectorSpaces[i] = new VectorSpace paramSpace( - env, "block_param_", blockSizes[i], NULL); + this->m_vectorSpaces[i] = new VectorSpace(m_env, + "block_param_", blockSizes[i], NULL); this->m_blocks[i] = new GslMatrix(this->m_vectorSpaces[i]->zeroVector(), diagValue); } @@ -51,16 +48,28 @@ GslBlockMatrix::~GslBlockMatrix() } } +GslMatrix & +GslBlockMatrix::getBlock(unsigned int i) const +{ + return *(this->m_blocks[i]); +} + +unsigned int +GslBlockMatrix::numBlocks() const +{ + return this->m_blocks.size(); +} + void GslBlockMatrix::invertMultiply(const GslVector & b, GslVector & x) const { unsigned int totalCols = 0; for (unsigned int i = 0; i < this->m_blocks.size(); i++) { - totalCols += this->m_blocks[i].numCols(); + totalCols += this->m_blocks[i]->numCols(); } - if (this->numCols() != b.sizeLocal()) { + if (totalCols != b.sizeLocal()) { queso_error_msg("block matrix and rhs have incompatible sizes"); } @@ -69,57 +78,56 @@ GslBlockMatrix::invertMultiply(const GslVector & b, GslVector & x) const } unsigned int blockOffset = 0; - double totalMisfit = 0.0; // Do an invertMultiply for each block for (unsigned int i = 0; i < this->m_blocks.size(); i++) { - GslVector blockRHS(this->m_vectorSpaces[i].zeroVector()); - GslVector blockSol(this->m_vectorSpaces[i].zeroVector()); + GslVector blockRHS(this->m_vectorSpaces[i]->zeroVector()); + GslVector blockSol(this->m_vectorSpaces[i]->zeroVector()); // Be sure to copy over the RHS to the right sized vector - for (unsigned int j = 0; j < this->m_blocks[i].numCols(); j++) { + for (unsigned int j = 0; j < this->m_blocks[i]->numCols(); j++) { blockRHS[j] = b[blockOffset + j]; } // Solve - this->m_block[i].invertMultiply(blockRHS, blockSol); + this->m_blocks[i]->invertMultiply(blockRHS, blockSol); // Be sure to copy the block solution back to the global solution vector - for (unsigned int j = 0; j < this->m_blocks[i].numCols(); j++) { + for (unsigned int j = 0; j < this->m_blocks[i]->numCols(); j++) { x[blockOffset + j] = blockSol[j]; } // Remember to increment the offset so we don't lose our place for the next // block - blockOffset += this->m_blocks[i].numCols(); + blockOffset += this->m_blocks[i]->numCols(); } } void GslBlockMatrix::print(std::ostream& os) const { - unsigned int nRows = this->numRowsLocal(); - unsigned int nCols = this->numCols(); - - if (m_printHorizontally) { - for (unsigned int i = 0; i < nRows; ++i) { - for (unsigned int j = 0; j < nCols; ++j) { - os << (*this)(i,j) - << " "; - } - if (i != (nRows-1)) os << "; "; - } - //os << std::endl; - } - else { - for (unsigned int i = 0; i < nRows; ++i) { - for (unsigned int j = 0; j < nCols; ++j) { - os << (*this)(i,j) - << " "; - } - os << std::endl; - } - } + // unsigned int nRows = this->numRowsLocal(); + // unsigned int nCols = this->numCols(); + // + // if (m_printHorizontally) { + // for (unsigned int i = 0; i < nRows; ++i) { + // for (unsigned int j = 0; j < nCols; ++j) { + // os << (*this)(i,j) + // << " "; + // } + // if (i != (nRows-1)) os << "; "; + // } + // //os << std::endl; + // } + // else { + // for (unsigned int i = 0; i < nRows; ++i) { + // for (unsigned int j = 0; j < nCols; ++j) { + // os << (*this)(i,j) + // << " "; + // } + // os << std::endl; + // } + // } return; } From ab3d4c0b65168191a981b62d27638f411f36fd53 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 30 Jan 2015 17:02:07 -0600 Subject: [PATCH 41/99] Adding canned Gaussian likelihood with block diag cov --- inc/queso/Makefile.am | 3 + src/Makefile.am | 2 + ...aussianLikelihoodBlockDiagonalCovariance.h | 74 +++++++++++++++ ...aussianLikelihoodBlockDiagonalCovariance.C | 93 +++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h create mode 100644 src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index c4cd532d8..80af5c724 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -107,6 +107,7 @@ BUILT_SOURCES += GammaVectorRV.h BUILT_SOURCES += GammaVectorRealizer.h BUILT_SOURCES += GaussianJointPdf.h BUILT_SOURCES += GaussianLikelihood.h +BUILT_SOURCES += GaussianLikelihoodBlockDiagonalCovariance.h BUILT_SOURCES += GaussianLikelihoodDiagonalCovariance.h BUILT_SOURCES += GaussianLikelihoodFullCovariance.h BUILT_SOURCES += GaussianLikelihoodScalarCovariance.h @@ -383,6 +384,8 @@ GaussianJointPdf.h: $(top_srcdir)/src/stats/inc/GaussianJointPdf.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihood.h: $(top_srcdir)/src/stats/inc/GaussianLikelihood.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihoodBlockDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodFullCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodFullCovariance.h diff --git a/src/Makefile.am b/src/Makefile.am index dd78433ac..73edbde1c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -241,6 +241,7 @@ libqueso_la_SOURCES += stats/src/GaussianLikelihood.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodScalarCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodDiagonalCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodFullCovariance.C +libqueso_la_SOURCES += stats/src/GaussianLikelihoodBlockDiagonalCovariance.C # Sources from gp/src @@ -428,6 +429,7 @@ libqueso_include_HEADERS += stats/inc/GaussianLikelihood.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodDiagonalCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodFullCovariance.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h # Headers to install from gp/inc diff --git a/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h new file mode 100644 index 000000000..60fd5540a --- /dev/null +++ b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h @@ -0,0 +1,74 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_H +#define UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_H + +#include +#include + +namespace QUESO { + +/*! + * \file GaussianLikelihoodBlockDiagonalCovariance.h + * + * \class GaussianLikelihoodBlockDiagonalCovariance + * \brief A class representing a Gaussian likelihood with block-diagonal cov + */ + +template +class GaussianLikelihoodBlockDiagonalCovariance : public BaseGaussianLikelihood { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * Instantiates a Gaussian likelihood function, given a prefix, its domain, a + * set of observations and a block diagonal covariance matrix. The diagonal + * covariance matrix is stored as a \c std::vector of \c GslMatrix objects + * representing each block matrix. + */ + GaussianLikelihoodBlockDiagonalCovariance(const char * prefix, + const VectorSet & domainSet, const V & observations, + const GslBlockMatrix & covariance); + + //! Destructor + virtual ~GaussianLikelihoodBlockDiagonalCovariance(); + //@} + + //! Actual value of the scalar function. + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + + //! Logarithm of the value of the scalar function. + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + +private: + const GslBlockMatrix & m_covariance; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_H diff --git a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C new file mode 100644 index 000000000..9eb2e92c2 --- /dev/null +++ b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C @@ -0,0 +1,93 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include + +namespace QUESO { + +template +GaussianLikelihoodBlockDiagonalCovariance::GaussianLikelihoodBlockDiagonalCovariance( + const char * prefix, const VectorSet & domainSet, + const V & observations, const GslBlockMatrix & covariance) + : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covariance(covariance) +{ + unsigned int totalDim = 0; + + for (unsigned int i = 0; i < this->m_covariance.numBlocks(); i++) { + totalDim += this->m_covariance.getBlock(i).numRowsLocal(); + } + + if (totalDim != observations.sizeLocal()) { + queso_error_msg("Covariance matrix not same size as observation vector"); + } +} + +template +GaussianLikelihoodBlockDiagonalCovariance::~GaussianLikelihoodBlockDiagonalCovariance() +{ +} + +template +double +GaussianLikelihoodBlockDiagonalCovariance::actualValue( + const V & domainVector, const V * domainDirection, V * gradVector, + M * hessianMatrix, V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); +} + +template +double +GaussianLikelihoodBlockDiagonalCovariance::lnValue( + const V & domainVector, const V * domainDirection, V * gradVector, + M * hessianMatrix, V * hessianEffect) const +{ + V modelOutput(this->m_observations, 0, 0); // At least it's not a copy + V weightedMisfit(this->m_observations, 0, 0); // At least it's not a copy + + this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector, + hessianMatrix, hessianEffect); + + // Compute misfit G(x) - y + modelOutput -= this->m_observations; + + // Solve \Sigma u = G(x) - y for u + this->m_covariance.invertMultiply(modelOutput, weightedMisfit); + + // Compute (G(x) - y)^T \Sigma^{-1} (G(x) - y) + modelOutput *= weightedMisfit; + + double norm2_squared = modelOutput.sumOfComponents(); // This is square of 2-norm + + return -0.5 * norm2_squared; +} + +} // End namespace QUESO + +template class QUESO::GaussianLikelihoodBlockDiagonalCovariance; From 306b7b0006dfd84ee9cdac4ae085b4c13c12172d Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 30 Jan 2015 17:02:47 -0600 Subject: [PATCH 42/99] Adding canned block diagonal covariance example --- examples/Makefile.am | 6 + .../blockDiagonalCovariance.C | 127 ++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 examples/gaussian_likelihoods/blockDiagonalCovariance.C diff --git a/examples/Makefile.am b/examples/Makefile.am index c3e427278..2128a3152 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -388,6 +388,12 @@ fullCovariance_SOURCES = gaussian_likelihoods/fullCovariance.C fullCovariance_LDADD = $(top_builddir)/src/libqueso.la fullCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/fullCovariance $(QUESO_CPPFLAGS) +blockDiagonalCovariancedir = $(prefix)/examples/gaussian_likelihoods +blockDiagonalCovariance_PROGRAMS = blockDiagonalCovariance +blockDiagonalCovariance_SOURCES = gaussian_likelihoods/blockDiagonalCovariance.C +blockDiagonalCovariance_LDADD = $(top_builddir)/src/libqueso.la +blockDiagonalCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/blockDiagonalCovariance $(QUESO_CPPFLAGS) + dist_gpmsa_scalar_DATA = dist_gpmsa_scalar_DATA += ${gpmsa_scalar_SOURCES} diff --git a/examples/gaussian_likelihoods/blockDiagonalCovariance.C b/examples/gaussian_likelihoods/blockDiagonalCovariance.C new file mode 100644 index 000000000..c0d441b64 --- /dev/null +++ b/examples/gaussian_likelihoods/blockDiagonalCovariance.C @@ -0,0 +1,127 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +class Likelihood : public QUESO::GaussianLikelihoodBlockDiagonalCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const QUESO::GslBlockMatrix & covariance) + : QUESO::GaussianLikelihoodBlockDiagonalCovariance(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = 1.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, argv[1], "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = 0.0; + double max_val = 1.0; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + + // Set up block sizes for observation covariance matrix + std::vector blockSizes(2); + blockSizes[0] = 1; // First block is 1x1 (scalar) + blockSizes[1] = 2; // Second block is 2x2 + + // Set up block matrix with specified block sizes + QUESO::GslBlockMatrix covariance(env, blockSizes, 1.0); // Identity matrix + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 3, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + observations[2] = 1.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + QUESO::GenericVectorRV + postRv("post_", paramSpace); + + QUESO::StatisticalInverseProblem + ip("", NULL, priorRv, lhood, postRv); + + QUESO::GslVector paramInitials(paramSpace.zeroVector()); + + paramInitials[0] = 0.0; + + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); + + for (unsigned int i = 0; i < 1; i++) { + proposalCovMatrix(i, i) = 0.1; + } + + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); + + MPI_Finalize(); + + return 0; +} From 9e7acfbfa7bded276f291c75c3cd5ef116670999 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 30 Jan 2015 17:03:21 -0600 Subject: [PATCH 43/99] Update ignores to include example binary --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bce58cd09..71dc65df5 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,7 @@ examples/template_example/template_example examples/scalarCovariance examples/diagonalCovariance examples/fullCovariance +examples/blockDiagonalCovariance src/core/inc/queso.h src/libqueso.la From cf5f6c302f14b99b6b142d242e6e1b2729e62a56 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 12:36:24 -0600 Subject: [PATCH 44/99] Add test case for likelihood with scalar cov --- .gitignore | 2 + configure.ac | 1 + test/Makefile.am | 6 + .../queso_input.txt.in | 48 +++++++ .../test_scalarCovariance.C | 119 ++++++++++++++++++ 5 files changed, 176 insertions(+) create mode 100644 test/test_gaussian_likelihoods/queso_input.txt.in create mode 100644 test/test_gaussian_likelihoods/test_scalarCovariance.C diff --git a/.gitignore b/.gitignore index 71dc65df5..f29c7de00 100644 --- a/.gitignore +++ b/.gitignore @@ -167,3 +167,5 @@ test/test_Regression/test_jeffreys_samples_diff.sh test/test_adaptedcov_output/ test/test_gpmsa_cobra_output/ test/test_logitadaptedcov +test/test_scalarCovariance +test/test_output_gaussian_likelihoods diff --git a/configure.ac b/configure.ac index 05b113938..6bd948a69 100644 --- a/configure.ac +++ b/configure.ac @@ -208,6 +208,7 @@ AC_CONFIG_FILES([ test/test_Regression/jeffreys_input.txt test/test_Regression/test_jeffreys_samples.m test/test_Regression/adaptedcov_input.txt + test/test_gaussian_likelihoods/queso_input.txt doxygen/Makefile doxygen/queso.dox doxygen/txt_common/about_vpath.page diff --git a/test/Makefile.am b/test/Makefile.am index 89e31702d..f9f04a583 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -35,6 +35,7 @@ check_PROGRAMS += test_gsloptimizer check_PROGRAMS += test_seedwithmap check_PROGRAMS += test_seedwithmap_fd check_PROGRAMS += test_logitadaptedcov +check_PROGRAMS += test_scalarCovariance LDADD = $(top_builddir)/src/libqueso.la @@ -95,6 +96,7 @@ test_gsloptimizer_SOURCES = test_optimizer/test_gsloptimizer.C test_seedwithmap_SOURCES = test_optimizer/test_seedwithmap.C test_seedwithmap_fd_SOURCES = test_optimizer/test_seedwithmap_fd.C test_logitadaptedcov_SOURCES = test_Regression/test_logitadaptedcov.C +test_scalarCovariance_SOURCES = test_gaussian_likelihoods/test_scalarCovariance.C # Files to freedom stamp srcstamp = @@ -127,6 +129,7 @@ srcstamp += $(test_gsloptimizer_SOURCES) srcstamp += $(test_seedwithmap_SOURCES) srcstamp += $(test_seedwithmap_fd_SOURCES) srcstamp += $(test_logitadaptedcov_SOURCES) +srcstamp += $(test_scalarCovariance_SOURCES) TESTS = TESTS += $(top_builddir)/test/test_uqEnvironmentCopy @@ -159,6 +162,7 @@ TESTS += $(top_builddir)/test/test_gsloptimizer TESTS += $(top_builddir)/test/test_seedwithmap TESTS += $(top_builddir)/test/test_seedwithmap_fd TESTS += $(top_builddir)/test/test_logitadaptedcov +TESTS += $(top_builddir)/test/test_scalarCovariance XFAIL_TESTS = $(top_builddir)/test/test_SequenceOfVectorsErase @@ -183,6 +187,7 @@ EXTRA_DIST += test_Regression/jeffreys_input.txt.in EXTRA_DIST += test_Regression/test_jeffreys_samples_diff.sh.in EXTRA_DIST += test_Regression/test_jeffreys_samples.m.in EXTRA_DIST += test_Regression/adaptedcov_input.txt.in +EXTRA_DIST += test_gaussian_likelihoods/queso_input.txt.in DISTCLEANFILES = DISTCLEANFILES += test_gpmsa_cobra_output/display_sub0.txt @@ -193,6 +198,7 @@ DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_logtarget.m DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_logtarget_sub0.m DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_sub0.m DISTCLEANFILES += test_gpmsa_cobra_output/sipOutput_sub0.m +DISTCLEANFILES += test_output_gaussian_likelihoods/display_sub0.txt CLEANFILES = CLEANFILES += $(top_srcdir)/test/test_Environment/debug_output_sub0.txt diff --git a/test/test_gaussian_likelihoods/queso_input.txt.in b/test/test_gaussian_likelihoods/queso_input.txt.in new file mode 100644 index 000000000..2aea16d49 --- /dev/null +++ b/test/test_gaussian_likelihoods/queso_input.txt.in @@ -0,0 +1,48 @@ +############################################### +# UQ Environment +############################################### +env_help = 1 +env_numSubEnvironments = 1 +env_subDisplayFileName = test_output_gaussian_likelihoods/display +env_subDisplayAllowAll = 0 +env_subDisplayAllowedSet = 0 +env_displayVerbosity = 1000 +env_syncVerbosity = 0 +env_seed = 0 + +############################################### +# Statistical inverse problem (ip) +############################################### +ip_help = anything +ip_computeSolution = 1 +ip_dataOutputFileName = test_output_gaussian_likelihoods/sipOutput +ip_dataOutputAllowedSet = 0 + +############################################### +# 'ip_': information for Metropolis-Hastings algorithm +############################################### +ip_mh_help = anything +ip_mh_dataOutputFileName = test_output_gaussian_likelihoods/sipOutput +ip_mh_dataOutputAllowedSet = 0 1 + +ip_mh_rawChain_dataInputFileName = . +ip_mh_rawChain_size = 1 +ip_mh_rawChain_generateExtra = 0 +ip_mh_rawChain_displayPeriod = 2000 +ip_mh_rawChain_measureRunTimes = 1 +ip_mh_rawChain_dataOutputFileName = test_output_gaussian_likelihoods/ip_raw_chain +ip_mh_rawChain_dataOutputAllowedSet = 0 1 +ip_mh_rawChain_computeStats = 1 + +ip_mh_displayCandidates = 0 +ip_mh_putOutOfBoundsInChain = 0 +ip_mh_tk_useLocalHessian = 0 +ip_mh_tk_useNewtonComponent = 0 +ip_mh_dr_maxNumExtraStages = 0 +ip_mh_dr_listOfScalesForExtraStages = 5. 10. 20. +ip_mh_am_initialNonAdaptInterval = 10 +ip_mh_am_adaptInterval = 1 +ip_mh_am_eta = 0.384 +ip_mh_am_epsilon = 1.e-5 + +ip_mh_filteredChain_generate = 0 diff --git a/test/test_gaussian_likelihoods/test_scalarCovariance.C b/test/test_gaussian_likelihoods/test_scalarCovariance.C new file mode 100644 index 000000000..c4f0d6f78 --- /dev/null +++ b/test/test_gaussian_likelihoods/test_scalarCovariance.C @@ -0,0 +1,119 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include + +#define TOL 1e-8 + +template +class Likelihood : public QUESO::GaussianLikelihoodScalarCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, double variance) + : QUESO::GaussianLikelihoodScalarCovariance(prefix, domain, + observations, variance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = domainVector[i] + 3.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "test_gaussian_likelihoods/queso_input.txt", "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = -INFINITY; + double max_val = INFINITY; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 1, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, 1.0); + + double lhood_value; + double truth_value; + QUESO::GslVector point(paramSpace.zeroVector()); + point[0] = 0.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = std::exp(-2.0); + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + point[0] = -2.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = 1.0; + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + MPI_Finalize(); + + return 0; +} From 4117134da5d2b7a0dc3b89b8a17e52160f2a41e6 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 14:00:29 -0600 Subject: [PATCH 45/99] Adding gaussian diagonal covariance test --- .gitignore | 2 + test/Makefile.am | 4 + .../test_diagonalCovariance.C | 128 ++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 test/test_gaussian_likelihoods/test_diagonalCovariance.C diff --git a/.gitignore b/.gitignore index f29c7de00..0de7e723f 100644 --- a/.gitignore +++ b/.gitignore @@ -168,4 +168,6 @@ test/test_adaptedcov_output/ test/test_gpmsa_cobra_output/ test/test_logitadaptedcov test/test_scalarCovariance +test/test_diagonalCovariance test/test_output_gaussian_likelihoods +test/test_gaussian_likelihoods/queso_input.txt diff --git a/test/Makefile.am b/test/Makefile.am index f9f04a583..c858b25d8 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -36,6 +36,7 @@ check_PROGRAMS += test_seedwithmap check_PROGRAMS += test_seedwithmap_fd check_PROGRAMS += test_logitadaptedcov check_PROGRAMS += test_scalarCovariance +check_PROGRAMS += test_diagonalCovariance LDADD = $(top_builddir)/src/libqueso.la @@ -97,6 +98,7 @@ test_seedwithmap_SOURCES = test_optimizer/test_seedwithmap.C test_seedwithmap_fd_SOURCES = test_optimizer/test_seedwithmap_fd.C test_logitadaptedcov_SOURCES = test_Regression/test_logitadaptedcov.C test_scalarCovariance_SOURCES = test_gaussian_likelihoods/test_scalarCovariance.C +test_diagonalCovariance_SOURCES = test_gaussian_likelihoods/test_diagonalCovariance.C # Files to freedom stamp srcstamp = @@ -130,6 +132,7 @@ srcstamp += $(test_seedwithmap_SOURCES) srcstamp += $(test_seedwithmap_fd_SOURCES) srcstamp += $(test_logitadaptedcov_SOURCES) srcstamp += $(test_scalarCovariance_SOURCES) +srcstamp += $(test_diagonalCovariance_SOURCES) TESTS = TESTS += $(top_builddir)/test/test_uqEnvironmentCopy @@ -163,6 +166,7 @@ TESTS += $(top_builddir)/test/test_seedwithmap TESTS += $(top_builddir)/test/test_seedwithmap_fd TESTS += $(top_builddir)/test/test_logitadaptedcov TESTS += $(top_builddir)/test/test_scalarCovariance +TESTS += $(top_builddir)/test/test_diagonalCovariance XFAIL_TESTS = $(top_builddir)/test/test_SequenceOfVectorsErase diff --git a/test/test_gaussian_likelihoods/test_diagonalCovariance.C b/test/test_gaussian_likelihoods/test_diagonalCovariance.C new file mode 100644 index 000000000..996295dac --- /dev/null +++ b/test/test_gaussian_likelihoods/test_diagonalCovariance.C @@ -0,0 +1,128 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include + +#define TOL 1e-8 + +template +class Likelihood : public QUESO::GaussianLikelihoodDiagonalCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const V & covariance) + : QUESO::GaussianLikelihoodDiagonalCovariance(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Model is a map from R to R^2 + + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = domainVector[0] + 3.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "test_gaussian_likelihoods/queso_input.txt", "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = 0.0; + double max_val = 1.0; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + + // Fill up covariance 'matrix' + QUESO::GslVector covariance(obsSpace.zeroVector()); + covariance[0] = 1.0; + covariance[1] = 2.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + double lhood_value; + double truth_value; + QUESO::GslVector point(paramSpace.zeroVector()); + point[0] = 0.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = std::exp(-3.0); + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + point[0] = -2.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = 1.0; + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + MPI_Finalize(); + + return 0; +} + From 99e11bfb8f2ff75d75209931e9cddbb941a9d730 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:09:06 -0600 Subject: [PATCH 46/99] Add full cov and block-diagonal cov gaussian tests --- .gitignore | 2 + test/Makefile.am | 8 ++ .../test_blockDiagonalCovariance.C | 136 ++++++++++++++++++ .../test_diagonalCovariance.C | 4 +- .../test_fullCovariance.C | 127 ++++++++++++++++ 5 files changed, 275 insertions(+), 2 deletions(-) create mode 100644 test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C create mode 100644 test/test_gaussian_likelihoods/test_fullCovariance.C diff --git a/.gitignore b/.gitignore index 0de7e723f..7d50cd2cb 100644 --- a/.gitignore +++ b/.gitignore @@ -169,5 +169,7 @@ test/test_gpmsa_cobra_output/ test/test_logitadaptedcov test/test_scalarCovariance test/test_diagonalCovariance +test/test_fullCovariance +test/test_blockDiagonalCovariance test/test_output_gaussian_likelihoods test/test_gaussian_likelihoods/queso_input.txt diff --git a/test/Makefile.am b/test/Makefile.am index c858b25d8..9b8d1d6d4 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -37,6 +37,8 @@ check_PROGRAMS += test_seedwithmap_fd check_PROGRAMS += test_logitadaptedcov check_PROGRAMS += test_scalarCovariance check_PROGRAMS += test_diagonalCovariance +check_PROGRAMS += test_fullCovariance +check_PROGRAMS += test_blockDiagonalCovariance LDADD = $(top_builddir)/src/libqueso.la @@ -99,6 +101,8 @@ test_seedwithmap_fd_SOURCES = test_optimizer/test_seedwithmap_fd.C test_logitadaptedcov_SOURCES = test_Regression/test_logitadaptedcov.C test_scalarCovariance_SOURCES = test_gaussian_likelihoods/test_scalarCovariance.C test_diagonalCovariance_SOURCES = test_gaussian_likelihoods/test_diagonalCovariance.C +test_fullCovariance_SOURCES = test_gaussian_likelihoods/test_fullCovariance.C +test_blockDiagonalCovariance_SOURCES = test_gaussian_likelihoods/test_blockDiagonalCovariance.C # Files to freedom stamp srcstamp = @@ -133,6 +137,8 @@ srcstamp += $(test_seedwithmap_fd_SOURCES) srcstamp += $(test_logitadaptedcov_SOURCES) srcstamp += $(test_scalarCovariance_SOURCES) srcstamp += $(test_diagonalCovariance_SOURCES) +srcstamp += $(test_fullCovariance_SOURCES) +srcstamp += $(test_blockDiagonalCovariance_SOURCES) TESTS = TESTS += $(top_builddir)/test/test_uqEnvironmentCopy @@ -167,6 +173,8 @@ TESTS += $(top_builddir)/test/test_seedwithmap_fd TESTS += $(top_builddir)/test/test_logitadaptedcov TESTS += $(top_builddir)/test/test_scalarCovariance TESTS += $(top_builddir)/test/test_diagonalCovariance +TESTS += $(top_builddir)/test/test_fullCovariance +TESTS += $(top_builddir)/test/test_blockDiagonalCovariance XFAIL_TESTS = $(top_builddir)/test/test_SequenceOfVectorsErase diff --git a/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C b/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C new file mode 100644 index 000000000..5705926e8 --- /dev/null +++ b/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C @@ -0,0 +1,136 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include + +#define TOL 1e-8 + +template +class Likelihood : public QUESO::GaussianLikelihoodBlockDiagonalCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const QUESO::GslBlockMatrix & covariance) + : QUESO::GaussianLikelihoodBlockDiagonalCovariance(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = domainVector[0] + 3.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "test_gaussian_likelihoods/queso_input.txt", "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = -INFINITY; + double max_val = INFINITY; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + // Set up block sizes for observation covariance matrix + std::vector blockSizes(2); + blockSizes[0] = 1; // First block is 1x1 (scalar) + blockSizes[1] = 2; // Second block is 2x2 + + // Set up block matrix with specified block sizes + QUESO::GslBlockMatrix covariance(env, blockSizes, 1.0); // Identity matrix + + covariance.getBlock(0)(0, 0) = 1.0; + covariance.getBlock(1)(0, 0) = 1.0; + covariance.getBlock(1)(0, 1) = 2.0; + covariance.getBlock(1)(1, 0) = 2.0; + covariance.getBlock(1)(1, 1) = 8.0; + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 3, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + observations[2] = 1.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + double lhood_value; + double truth_value; + QUESO::GslVector point(paramSpace.zeroVector()); + point[0] = 0.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = std::exp(-4.5); + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + point[0] = -2.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = 1.0; + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + MPI_Finalize(); + + return 0; +} diff --git a/test/test_gaussian_likelihoods/test_diagonalCovariance.C b/test/test_gaussian_likelihoods/test_diagonalCovariance.C index 996295dac..68d347af1 100644 --- a/test/test_gaussian_likelihoods/test_diagonalCovariance.C +++ b/test/test_gaussian_likelihoods/test_diagonalCovariance.C @@ -67,8 +67,8 @@ int main(int argc, char ** argv) { QUESO::VectorSpace paramSpace(env, "param_", 1, NULL); - double min_val = 0.0; - double max_val = 1.0; + double min_val = -INFINITY; + double max_val = INFINITY; QUESO::GslVector paramMins(paramSpace.zeroVector()); paramMins.cwSet(min_val); diff --git a/test/test_gaussian_likelihoods/test_fullCovariance.C b/test/test_gaussian_likelihoods/test_fullCovariance.C new file mode 100644 index 000000000..cd0408d39 --- /dev/null +++ b/test/test_gaussian_likelihoods/test_fullCovariance.C @@ -0,0 +1,127 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include + +#define TOL 1e-8 + +template +class Likelihood : public QUESO::GaussianLikelihoodFullCovariance +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const M & covariance) + : QUESO::GaussianLikelihoodFullCovariance(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = domainVector[0] + 3.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "test_gaussian_likelihoods/queso_input.txt", "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 1, NULL); + + double min_val = -INFINITY; + double max_val = INFINITY; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + paramMins.cwSet(min_val); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + paramMaxs.cwSet(max_val); + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + + // Fill up covariance 'matrix' + QUESO::GslMatrix covariance(obsSpace.zeroVector()); + covariance(0, 0) = 1.0; + covariance(0, 1) = 2.0; + covariance(1, 0) = 2.0; + covariance(1, 1) = 8.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + double lhood_value; + double truth_value; + QUESO::GslVector point(paramSpace.zeroVector()); + point[0] = 0.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = std::exp(-2.5); + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + point[0] = -2.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = 1.0; + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + MPI_Finalize(); + + return 0; +} From d3c936ef7a72b73a732560415a6106e28e02c1dc Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:18:48 -0600 Subject: [PATCH 47/99] Tidy up GslBlockMatrix docs --- src/core/inc/GslBlockMatrix.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/core/inc/GslBlockMatrix.h b/src/core/inc/GslBlockMatrix.h index 38e3feecf..7f37cca44 100644 --- a/src/core/inc/GslBlockMatrix.h +++ b/src/core/inc/GslBlockMatrix.h @@ -27,7 +27,7 @@ /*! * \file GslBlockMatrix.h - * \brief QUESO matrix class using GSL. + * \brief QUESO block matrix class using GSL. */ #include @@ -40,11 +40,10 @@ namespace QUESO { /*! * \class GslBlockMatrix - * \brief Class for matrix operations using GSL library. + * \brief Class for representing block matrices using GSL library. * - * This class creates and provides basic support for matrices of templated - * type as a specialization of Matrix using GSL matrices, which are defined - * by an encapsulated gsl_matrix structure. + * This class provides basic 'invertMultiply' support for matrices of block + * diagonal structure. Each block is implemented as a GslMatrix object. */ class GslBlockMatrix @@ -52,7 +51,10 @@ class GslBlockMatrix public: //! @name Constructor/Destructor methods //@{ - //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. + //! Creates a square matrix with size defined by \c blockSizes and diagonal values all equal to \c diagValue. + /*! + * The \c blockSizes array must contain the sizes of each (square) block. + */ GslBlockMatrix(const FullEnvironment & env, const std::vector & blockSizes, double diagValue); @@ -68,8 +70,8 @@ class GslBlockMatrix //! This function calculates the inverse of \c this matrix, multiplies it with vector \c b and stores the result in vector \c x. /*! - * It checks for a previous LU decomposition of \c this matrix and does not - * recompute it if m_MU != NULL. + * It checks for a previous LU decomposition of each block matrix and does + * not recompute it if m_MU != NULL for each block. */ void invertMultiply(const GslVector & b, GslVector & x) const; From 770a7ff62b51662c8149eecf450cb7f06b78ef16 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:19:04 -0600 Subject: [PATCH 48/99] Finish up GslBlockMatrix print implementation --- src/core/src/GslBlockMatrix.C | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/src/core/src/GslBlockMatrix.C b/src/core/src/GslBlockMatrix.C index 4dbdac2be..1f4fd8638 100644 --- a/src/core/src/GslBlockMatrix.C +++ b/src/core/src/GslBlockMatrix.C @@ -106,30 +106,9 @@ GslBlockMatrix::invertMultiply(const GslVector & b, GslVector & x) const void GslBlockMatrix::print(std::ostream& os) const { - // unsigned int nRows = this->numRowsLocal(); - // unsigned int nCols = this->numCols(); - // - // if (m_printHorizontally) { - // for (unsigned int i = 0; i < nRows; ++i) { - // for (unsigned int j = 0; j < nCols; ++j) { - // os << (*this)(i,j) - // << " "; - // } - // if (i != (nRows-1)) os << "; "; - // } - // //os << std::endl; - // } - // else { - // for (unsigned int i = 0; i < nRows; ++i) { - // for (unsigned int j = 0; j < nCols; ++j) { - // os << (*this)(i,j) - // << " "; - // } - // os << std::endl; - // } - // } - - return; + for (unsigned int i = 0; i < this->numBlocks(); i++) { + this->getBlock(i).print(os); + } } std::ostream& From 6014215274a8ccc37c13c1c4d81ba1ece4eaaa60 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:21:37 -0600 Subject: [PATCH 49/99] Tidy up BaseGaussianLikelihood docs --- src/stats/inc/GaussianLikelihood.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h index 8fe540384..69dd6149a 100644 --- a/src/stats/inc/GaussianLikelihood.h +++ b/src/stats/inc/GaussianLikelihood.h @@ -62,10 +62,10 @@ class BaseGaussianLikelihood : public BaseScalarFunction { //! Evaluates the user's model at the point \c domainVector /*! * This is pure virtual, so the user must implement this when subclassing a - * Gaussian likelihood class. Note that, what is returned is not an object - * of type \c V, but an array of type \c double. This represents a vector of - * synthetic observations that will be to compare to actual observations when - * computing the likelihood functional. + * Gaussian likelihood class. Note that, what is returned is void. The user + * will fill up the \c modelOutput vector with output from the model. + * This represents a vector of synthetic observations that will be to compare + * to actual observations when computing the likelihood functional. */ virtual void evaluateModel(const V & domainVector, const V * domainDirection, V & modelOutput, V * gradVector, M * hessianMatrix, From 965730bf9790154b50878b6d35929968bb77d293 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:24:28 -0600 Subject: [PATCH 50/99] Tidy up GaussianLikelihoodBlockDiagonalCovariance docs --- src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h index 60fd5540a..fac06daf3 100644 --- a/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h +++ b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h @@ -34,7 +34,7 @@ namespace QUESO { * \file GaussianLikelihoodBlockDiagonalCovariance.h * * \class GaussianLikelihoodBlockDiagonalCovariance - * \brief A class representing a Gaussian likelihood with block-diagonal cov + * \brief A class representing a Gaussian likelihood with block-diagonal covariance matrix */ template @@ -45,9 +45,9 @@ class GaussianLikelihoodBlockDiagonalCovariance : public BaseGaussianLikelihood< //! Default constructor. /*! * Instantiates a Gaussian likelihood function, given a prefix, its domain, a - * set of observations and a block diagonal covariance matrix. The diagonal - * covariance matrix is stored as a \c std::vector of \c GslMatrix objects - * representing each block matrix. + * vector of observations and a block diagonal covariance matrix. + * The diagonal covariance matrix is of type \c GslBlockMatrix. Each block + * in the block diagonal matrix is an object of type \c GslMatrix. */ GaussianLikelihoodBlockDiagonalCovariance(const char * prefix, const VectorSet & domainSet, const V & observations, From 80f66dfe1f0f4bfce1318b166a7cefec5860cf9f Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:25:23 -0600 Subject: [PATCH 51/99] Tidy up GaussianLikelihoodDiagonalCovariance docs --- src/stats/inc/GaussianLikelihoodDiagonalCovariance.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h b/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h index 50c4e3516..b1587ea7e 100644 --- a/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h +++ b/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h @@ -33,7 +33,7 @@ namespace QUESO { * \file GaussianLikelihoodDiagonalCovariance.h * * \class GaussianLikelihoodDiagonalCovariance - * \brief A class that represents a Gaussian likelihood with scalar covariance + * \brief A class that represents a Gaussian likelihood with diagonal covariance matrix */ template From 1860dafc4a78b5e07a76af4060027fbca54c30d6 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 2 Feb 2015 15:26:54 -0600 Subject: [PATCH 52/99] Tidy up GaussianLikelihoodScalarCovariance docs --- src/stats/inc/GaussianLikelihoodScalarCovariance.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stats/inc/GaussianLikelihoodScalarCovariance.h b/src/stats/inc/GaussianLikelihoodScalarCovariance.h index aa3bc4150..37b927f0b 100644 --- a/src/stats/inc/GaussianLikelihoodScalarCovariance.h +++ b/src/stats/inc/GaussianLikelihoodScalarCovariance.h @@ -44,7 +44,8 @@ class GaussianLikelihoodScalarCovariance : public BaseGaussianLikelihood { //! Default constructor. /*! * Instantiates a Gaussian likelihood function, given a prefix, its domain, - * a set of observations and a scalar covariance matrix. + * a set of observations and a scalar covariance matrix. The scalar + * 'covariance matrix' is just passed as a \c double. */ GaussianLikelihoodScalarCovariance(const char * prefix, const VectorSet & domainSet, const V & observations, From 58d712ffee9ad6d8ad4c7d2e10716f2d7521fa8f Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 5 Mar 2015 20:16:34 -0600 Subject: [PATCH 53/99] Make error message clearer --- src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C index 9eb2e92c2..f3eff2621 100644 --- a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C +++ b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C @@ -43,7 +43,7 @@ GaussianLikelihoodBlockDiagonalCovariance::GaussianLikelihoodBlockDiagonal } if (totalDim != observations.sizeLocal()) { - queso_error_msg("Covariance matrix not same size as observation vector"); + queso_error_msg("Covariance matrix not same dimension as observation vector"); } } From 3c8eb5b0a4711fc9a562b7269c81079db3a042b0 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 5 Mar 2015 21:07:02 -0600 Subject: [PATCH 54/99] Add test for GslBlockMatrix::invertMultiply --- .gitignore | 1 + test/Makefile.am | 4 ++ .../test_GslBlockMatrixInvertMultiply.C | 68 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C diff --git a/.gitignore b/.gitignore index 7d50cd2cb..175b77cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -173,3 +173,4 @@ test/test_fullCovariance test/test_blockDiagonalCovariance test/test_output_gaussian_likelihoods test/test_gaussian_likelihoods/queso_input.txt +test/test_GslBlockMatrixInvertMultiply diff --git a/test/Makefile.am b/test/Makefile.am index 9b8d1d6d4..511705da3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -39,6 +39,7 @@ check_PROGRAMS += test_scalarCovariance check_PROGRAMS += test_diagonalCovariance check_PROGRAMS += test_fullCovariance check_PROGRAMS += test_blockDiagonalCovariance +check_PROGRAMS += test_GslBlockMatrixInvertMultiply LDADD = $(top_builddir)/src/libqueso.la @@ -103,6 +104,7 @@ test_scalarCovariance_SOURCES = test_gaussian_likelihoods/test_scalarCovariance. test_diagonalCovariance_SOURCES = test_gaussian_likelihoods/test_diagonalCovariance.C test_fullCovariance_SOURCES = test_gaussian_likelihoods/test_fullCovariance.C test_blockDiagonalCovariance_SOURCES = test_gaussian_likelihoods/test_blockDiagonalCovariance.C +test_GslBlockMatrixInvertMultiply_SOURCES = test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C # Files to freedom stamp srcstamp = @@ -139,6 +141,7 @@ srcstamp += $(test_scalarCovariance_SOURCES) srcstamp += $(test_diagonalCovariance_SOURCES) srcstamp += $(test_fullCovariance_SOURCES) srcstamp += $(test_blockDiagonalCovariance_SOURCES) +srcstamp += $(test_GslBlockMatrixInvertMultiply_SOURCES) TESTS = TESTS += $(top_builddir)/test/test_uqEnvironmentCopy @@ -175,6 +178,7 @@ TESTS += $(top_builddir)/test/test_scalarCovariance TESTS += $(top_builddir)/test/test_diagonalCovariance TESTS += $(top_builddir)/test/test_fullCovariance TESTS += $(top_builddir)/test/test_blockDiagonalCovariance +TESTS += $(top_builddir)/test/test_GslBlockMatrixInvertMultiply XFAIL_TESTS = $(top_builddir)/test/test_SequenceOfVectorsErase diff --git a/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C b/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C new file mode 100644 index 000000000..ab2b808e4 --- /dev/null +++ b/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C @@ -0,0 +1,68 @@ +#include + +#include +#include +#include +#include +#include + +#define TOL 1e-10 + +int main(int argc, char **argv) { + MPI_Init(&argc, &argv); + + QUESO::EnvOptionsValues options; + options.m_numSubEnvironments = 1; + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "", "", &options); + + QUESO::VectorSpace paramSpace(env, + "param_", 3, NULL); + + // Set up block sizes for observation covariance matrix + std::vector blockSizes(2); + blockSizes[0] = 1; // First block is 1x1 (scalar) + blockSizes[1] = 2; // Second block is 2x2 + + // Set up block matrix with specified block sizes + QUESO::GslBlockMatrix covariance(env, blockSizes, 1.0); // Identity matrix + + // The matrix [[1, 0, 0], [0, 1, 2], [0, 2, 8]] + // has inverse 0.25 * [[1, 0, 0], [0, 2, -0.5], [0, -0.5, 0.25]] + covariance.getBlock(0)(0, 0) = 1.0; + covariance.getBlock(1)(0, 0) = 1.0; + covariance.getBlock(1)(0, 1) = 2.0; + covariance.getBlock(1)(1, 0) = 2.0; + covariance.getBlock(1)(1, 1) = 8.0; + + // Example RHS + QUESO::GslVector b(paramSpace.zeroVector()); + b[0] = 1.0; + b[1] = 2.0; + b[2] = 3.0; + + // Compute solution + QUESO::GslVector x(paramSpace.zeroVector()); + covariance.invertMultiply(b, x); + + // This is the analytical solution + QUESO::GslVector sol(paramSpace.zeroVector()); + sol[0] = 1.0; + sol[1] = 2.5; + sol[2] = -0.25; + + // So if the solve worked, this sucker should be the zero vector + sol -= x; + + // So its norm should be zero + if (sol.norm2() > TOL) { + std::cerr << "Computed solution:" << std::endl; + std::cerr << b << std::endl; + std::cerr << "Actual solution:" << std::endl; + std::cerr << sol << std::endl; + queso_error_msg("TEST: GslBlockMatrix::invertMultiply failed."); + } + + MPI_Finalize(); + return 0; +} From dc2e7e8f747b52fffde1ca293295185533cbac2e Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 5 Mar 2015 21:07:34 -0600 Subject: [PATCH 55/99] Update changelog --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index a102d7962..7523e95af 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,9 @@ QUESO: Quantification of Uncertainty for Estimation, Simulation, and Optimization. ----------------------------------------------------- +Version 0.52.0 + * Add canned Gaussian likelihoods + Version 0.51.0 * Add canned likelihood for scalar GPMSA use-case a la Higdon et al * Add a logit-transformed transition kernel for more efficient proposals From e6b7ec0547f083469796905e5871ed3cf94e3359 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 10:32:20 -0600 Subject: [PATCH 56/99] Make GslBlockMatrix subclass Matrix and update tests/egs --- .../blockDiagonalCovariance.C | 16 +++---- src/core/inc/GslBlockMatrix.h | 33 ++++++++++--- src/core/src/GslBlockMatrix.C | 48 +++++++++++++++++-- .../test_GslBlockMatrixInvertMultiply.C | 16 +++---- .../test_blockDiagonalCovariance.C | 24 +++++----- 5 files changed, 99 insertions(+), 38 deletions(-) diff --git a/examples/gaussian_likelihoods/blockDiagonalCovariance.C b/examples/gaussian_likelihoods/blockDiagonalCovariance.C index c0d441b64..55ecd5f1b 100644 --- a/examples/gaussian_likelihoods/blockDiagonalCovariance.C +++ b/examples/gaussian_likelihoods/blockDiagonalCovariance.C @@ -81,14 +81,6 @@ int main(int argc, char ** argv) { QUESO::UniformVectorRV priorRv("prior_", paramDomain); - // Set up block sizes for observation covariance matrix - std::vector blockSizes(2); - blockSizes[0] = 1; // First block is 1x1 (scalar) - blockSizes[1] = 2; // Second block is 2x2 - - // Set up block matrix with specified block sizes - QUESO::GslBlockMatrix covariance(env, blockSizes, 1.0); // Identity matrix - // Set up observation space QUESO::VectorSpace obsSpace(env, "obs_", 3, NULL); @@ -99,6 +91,14 @@ int main(int argc, char ** argv) { observations[1] = 1.0; observations[2] = 1.0; + // Set up block sizes for observation covariance matrix + std::vector blockSizes(2); + blockSizes[0] = 1; // First block is 1x1 (scalar) + blockSizes[1] = 2; // Second block is 2x2 + + // Set up block matrix (identity matrix) with specified block sizes + QUESO::GslBlockMatrix covariance(blockSizes, observations, 1.0); + // Pass in observations to Gaussian likelihood object Likelihood lhood("llhd_", paramDomain, observations, covariance); diff --git a/src/core/inc/GslBlockMatrix.h b/src/core/inc/GslBlockMatrix.h index 7f37cca44..ba1dc6190 100644 --- a/src/core/inc/GslBlockMatrix.h +++ b/src/core/inc/GslBlockMatrix.h @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -46,22 +47,40 @@ namespace QUESO { * diagonal structure. Each block is implemented as a GslMatrix object. */ -class GslBlockMatrix +class GslBlockMatrix : Matrix { public: //! @name Constructor/Destructor methods //@{ - //! Creates a square matrix with size defined by \c blockSizes and diagonal values all equal to \c diagValue. + //! Creates a square matrix with size defined by \c v and diagonal values all equal to \c diagValue. /*! - * The \c blockSizes array must contain the sizes of each (square) block. + * The \c blockSizes array determines the sizes of each (square) block. */ - GslBlockMatrix(const FullEnvironment & env, - const std::vector & blockSizes, double diagValue); + GslBlockMatrix(const std::vector & blockSizes, + const GslVector & v, double diagValue); //! Destructor ~GslBlockMatrix(); //@} + //! Not implemented yet + virtual unsigned int numRowsLocal() const; + + //! Not implemented yet + virtual unsigned int numRowsGlobal() const; + + //! Not implemented yet + virtual unsigned int numCols() const; + + //! Not implemented yet + virtual int chol(); + + //! Not implemented yet + virtual void zeroLower(bool includeDiagonal=false); + + //! Not implemented yet + virtual void zeroUpper(bool includeDiagonal=false); + //! Return block \c i in the block diagonal matrix GslMatrix & getBlock(unsigned int i) const; @@ -78,11 +97,11 @@ class GslBlockMatrix //! @name I/O methods //@{ //! Print method. Defines the behavior of operator<< inherited from the Object class. - void print (std::ostream & os) const; + virtual void print (std::ostream & os) const; //@} private: - const FullEnvironment & m_env; + const BaseEnvironment & m_env; std::vector *> m_vectorSpaces; std::vector m_blocks; }; diff --git a/src/core/src/GslBlockMatrix.C b/src/core/src/GslBlockMatrix.C index 1f4fd8638..e601eb22a 100644 --- a/src/core/src/GslBlockMatrix.C +++ b/src/core/src/GslBlockMatrix.C @@ -26,9 +26,10 @@ namespace QUESO { -GslBlockMatrix::GslBlockMatrix(const FullEnvironment & env, - const std::vector & blockSizes, double diagValue) - : m_env(env), +GslBlockMatrix::GslBlockMatrix(const std::vector & blockSizes, + const GslVector & v, double diagValue) + : Matrix(v.env(), v.map()), + m_env(v.env()), m_vectorSpaces(blockSizes.size()), m_blocks(blockSizes.size()) { @@ -48,6 +49,47 @@ GslBlockMatrix::~GslBlockMatrix() } } + +unsigned int +GslBlockMatrix::numRowsLocal() const +{ + queso_not_implemented(); +} + +unsigned int +GslBlockMatrix::numRowsGlobal() const +{ + queso_not_implemented(); + return 0; +} + +unsigned int +GslBlockMatrix::numCols() const +{ + queso_not_implemented(); + return 0; +} + +int +GslBlockMatrix::chol() +{ + queso_not_implemented(); + return 0; +} + +void +GslBlockMatrix::zeroLower(bool includeDiagonal) +{ + queso_not_implemented(); +} + +void +GslBlockMatrix::zeroUpper(bool includeDiagonal) +{ + queso_not_implemented(); +} + + GslMatrix & GslBlockMatrix::getBlock(unsigned int i) const { diff --git a/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C b/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C index ab2b808e4..be6d0a5c4 100644 --- a/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C +++ b/test/test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C @@ -19,13 +19,19 @@ int main(int argc, char **argv) { QUESO::VectorSpace paramSpace(env, "param_", 3, NULL); + // Example RHS + QUESO::GslVector b(paramSpace.zeroVector()); + b[0] = 1.0; + b[1] = 2.0; + b[2] = 3.0; + // Set up block sizes for observation covariance matrix std::vector blockSizes(2); blockSizes[0] = 1; // First block is 1x1 (scalar) blockSizes[1] = 2; // Second block is 2x2 - // Set up block matrix with specified block sizes - QUESO::GslBlockMatrix covariance(env, blockSizes, 1.0); // Identity matrix + // Set up block (identity) matrix with specified block sizes + QUESO::GslBlockMatrix covariance(blockSizes, b, 1.0); // The matrix [[1, 0, 0], [0, 1, 2], [0, 2, 8]] // has inverse 0.25 * [[1, 0, 0], [0, 2, -0.5], [0, -0.5, 0.25]] @@ -35,12 +41,6 @@ int main(int argc, char **argv) { covariance.getBlock(1)(1, 0) = 2.0; covariance.getBlock(1)(1, 1) = 8.0; - // Example RHS - QUESO::GslVector b(paramSpace.zeroVector()); - b[0] = 1.0; - b[1] = 2.0; - b[2] = 3.0; - // Compute solution QUESO::GslVector x(paramSpace.zeroVector()); covariance.invertMultiply(b, x); diff --git a/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C b/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C index 5705926e8..57ad41c24 100644 --- a/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C +++ b/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C @@ -77,13 +77,23 @@ int main(int argc, char ** argv) { QUESO::BoxSubset paramDomain("param_", paramSpace, paramMins, paramMaxs); + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 3, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + observations[2] = 1.0; + // Set up block sizes for observation covariance matrix std::vector blockSizes(2); blockSizes[0] = 1; // First block is 1x1 (scalar) blockSizes[1] = 2; // Second block is 2x2 - // Set up block matrix with specified block sizes - QUESO::GslBlockMatrix covariance(env, blockSizes, 1.0); // Identity matrix + // Set up block (identity) matrix with specified block sizes + QUESO::GslBlockMatrix covariance(blockSizes, observations, 1.0); covariance.getBlock(0)(0, 0) = 1.0; covariance.getBlock(1)(0, 0) = 1.0; @@ -91,16 +101,6 @@ int main(int argc, char ** argv) { covariance.getBlock(1)(1, 0) = 2.0; covariance.getBlock(1)(1, 1) = 8.0; - // Set up observation space - QUESO::VectorSpace obsSpace(env, - "obs_", 3, NULL); - - // Fill up observation vector - QUESO::GslVector observations(obsSpace.zeroVector()); - observations[0] = 1.0; - observations[1] = 1.0; - observations[2] = 1.0; - // Pass in observations to Gaussian likelihood object Likelihood lhood("llhd_", paramDomain, observations, covariance); From 9ffbab5788902269145fb5f40444bdd458d5dc77 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 11:10:08 -0600 Subject: [PATCH 57/99] Remove member that was inherited from the base class --- src/core/inc/GslBlockMatrix.h | 1 - src/core/src/GslBlockMatrix.C | 1 - 2 files changed, 2 deletions(-) diff --git a/src/core/inc/GslBlockMatrix.h b/src/core/inc/GslBlockMatrix.h index ba1dc6190..f11cadad8 100644 --- a/src/core/inc/GslBlockMatrix.h +++ b/src/core/inc/GslBlockMatrix.h @@ -101,7 +101,6 @@ class GslBlockMatrix : Matrix //@} private: - const BaseEnvironment & m_env; std::vector *> m_vectorSpaces; std::vector m_blocks; }; diff --git a/src/core/src/GslBlockMatrix.C b/src/core/src/GslBlockMatrix.C index e601eb22a..c170c8784 100644 --- a/src/core/src/GslBlockMatrix.C +++ b/src/core/src/GslBlockMatrix.C @@ -29,7 +29,6 @@ namespace QUESO { GslBlockMatrix::GslBlockMatrix(const std::vector & blockSizes, const GslVector & v, double diagValue) : Matrix(v.env(), v.map()), - m_env(v.env()), m_vectorSpaces(blockSizes.size()), m_blocks(blockSizes.size()) { From 3e92833fc6cc67912aae70094416c847c58dfd29 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 12:35:49 -0600 Subject: [PATCH 58/99] Add a coefficient for cov matrix in Gaussian llhd --- examples/gaussian_likelihoods/fullCovariance.C | 2 +- src/stats/inc/GaussianLikelihoodFullCovariance.h | 7 ++++++- src/stats/src/GaussianLikelihoodFullCovariance.C | 5 +++-- test/test_gaussian_likelihoods/test_fullCovariance.C | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/gaussian_likelihoods/fullCovariance.C b/examples/gaussian_likelihoods/fullCovariance.C index 9ecdf801a..3d157b8ee 100644 --- a/examples/gaussian_likelihoods/fullCovariance.C +++ b/examples/gaussian_likelihoods/fullCovariance.C @@ -35,12 +35,12 @@ template class Likelihood : public QUESO::GaussianLikelihoodFullCovariance { public: - Likelihood(const char * prefix, const QUESO::VectorSet & domain, const V & observations, const M & covariance) : QUESO::GaussianLikelihoodFullCovariance(prefix, domain, observations, covariance) { + // Default covariance coefficient is 1.0 } virtual ~Likelihood() diff --git a/src/stats/inc/GaussianLikelihoodFullCovariance.h b/src/stats/inc/GaussianLikelihoodFullCovariance.h index c7867aea1..7b3c4d2ce 100644 --- a/src/stats/inc/GaussianLikelihoodFullCovariance.h +++ b/src/stats/inc/GaussianLikelihoodFullCovariance.h @@ -46,10 +46,14 @@ class GaussianLikelihoodFullCovariance : public BaseGaussianLikelihood { * Instantiates a Gaussian likelihood function, given a prefix, its domain, * a set of observations and a full covariance matrix. The full * covariance matrix is stored as a matrix in the \c covariance parameter. + * + * The parameter \c covarianceCoefficient is a multiplying factor of + * \c covaraince and is fixed (i.e. not solved for in a statistical + * inversion). */ GaussianLikelihoodFullCovariance(const char * prefix, const VectorSet & domainSet, const V & observations, - const M & covariance); + const M & covariance, double covarianceCoefficient=1.0); //! Destructor virtual ~GaussianLikelihoodFullCovariance(); @@ -64,6 +68,7 @@ class GaussianLikelihoodFullCovariance : public BaseGaussianLikelihood { V * gradVector, M * hessianMatrix, V * hessianEffect) const; private: + double m_covarianceCoefficient; const M & m_covariance; }; diff --git a/src/stats/src/GaussianLikelihoodFullCovariance.C b/src/stats/src/GaussianLikelihoodFullCovariance.C index 44d0db591..0df1cb141 100644 --- a/src/stats/src/GaussianLikelihoodFullCovariance.C +++ b/src/stats/src/GaussianLikelihoodFullCovariance.C @@ -32,8 +32,9 @@ namespace QUESO { template GaussianLikelihoodFullCovariance::GaussianLikelihoodFullCovariance( const char * prefix, const VectorSet & domainSet, - const V & observations, const M & covariance) + const V & observations, const M & covariance, double covarianceCoefficient) : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covarianceCoefficient(covarianceCoefficient), m_covariance(covariance) { if (covariance.numRowsLocal() != observations.sizeLocal()) { @@ -80,7 +81,7 @@ GaussianLikelihoodFullCovariance::lnValue(const V & domainVector, // This is square of 2-norm double norm2_squared = modelOutput.sumOfComponents(); - return -0.5 * norm2_squared; + return -0.5 * norm2_squared / (this->m_covarianceCoefficient); } } // End namespace QUESO diff --git a/test/test_gaussian_likelihoods/test_fullCovariance.C b/test/test_gaussian_likelihoods/test_fullCovariance.C index cd0408d39..09c054d03 100644 --- a/test/test_gaussian_likelihoods/test_fullCovariance.C +++ b/test/test_gaussian_likelihoods/test_fullCovariance.C @@ -40,6 +40,7 @@ public: : QUESO::GaussianLikelihoodFullCovariance(prefix, domain, observations, covariance) { + // Default covariance coefficient is 1.0 } virtual ~Likelihood() From 885552754defdd85dc19fef9cde8f63629651f9f Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 14:30:50 -0600 Subject: [PATCH 59/99] Adding new full Gaussian likelihood with rand coeff --- inc/queso/Makefile.am | 3 + src/Makefile.am | 2 + ...ikelihoodFullCovarianceRandomCoefficient.h | 77 +++++++++++++++ ...ikelihoodFullCovarianceRandomCoefficient.C | 95 +++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 src/stats/inc/GaussianLikelihoodFullCovarianceRandomCoefficient.h create mode 100644 src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index 80af5c724..5c2a0e80f 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -110,6 +110,7 @@ BUILT_SOURCES += GaussianLikelihood.h BUILT_SOURCES += GaussianLikelihoodBlockDiagonalCovariance.h BUILT_SOURCES += GaussianLikelihoodDiagonalCovariance.h BUILT_SOURCES += GaussianLikelihoodFullCovariance.h +BUILT_SOURCES += GaussianLikelihoodFullCovarianceRandomCoefficient.h BUILT_SOURCES += GaussianLikelihoodScalarCovariance.h BUILT_SOURCES += GaussianVectorCdf.h BUILT_SOURCES += GaussianVectorMdf.h @@ -390,6 +391,8 @@ GaussianLikelihoodDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLike $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodFullCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodFullCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihoodFullCovarianceRandomCoefficient.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodFullCovarianceRandomCoefficient.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodScalarCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodScalarCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianVectorCdf.h: $(top_srcdir)/src/stats/inc/GaussianVectorCdf.h diff --git a/src/Makefile.am b/src/Makefile.am index 73edbde1c..7bff5ff09 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -241,6 +241,7 @@ libqueso_la_SOURCES += stats/src/GaussianLikelihood.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodScalarCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodDiagonalCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodFullCovariance.C +libqueso_la_SOURCES += stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodBlockDiagonalCovariance.C # Sources from gp/src @@ -429,6 +430,7 @@ libqueso_include_HEADERS += stats/inc/GaussianLikelihood.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodDiagonalCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodFullCovariance.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihoodFullCovarianceRandomCoefficient.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h # Headers to install from gp/inc diff --git a/src/stats/inc/GaussianLikelihoodFullCovarianceRandomCoefficient.h b/src/stats/inc/GaussianLikelihoodFullCovarianceRandomCoefficient.h new file mode 100644 index 000000000..70f2f9f6b --- /dev/null +++ b/src/stats/inc/GaussianLikelihoodFullCovarianceRandomCoefficient.h @@ -0,0 +1,77 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LIKELIHOOD_FULL_COV_RAND_COEFF_H +#define UQ_GAUSSIAN_LIKELIHOOD_FULL_COV_RAND_COEFF_H + +#include + +namespace QUESO { + +/*! + * \file GaussianLikelihoodFullCovarianceRandomCoefficient.h + * + * \class GaussianLikelihoodFullCovarianceRandomCoefficient + * \brief A class that represents a Gaussian likelihood with full covariance and random coefficient + */ + +template +class GaussianLikelihoodFullCovarianceRandomCoefficient : public BaseGaussianLikelihood { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * Instantiates a Gaussian likelihood function, given a prefix, its domain, + * a set of observations and a full covariance matrix. The full + * covariance matrix is stored as a matrix in the \c covariance parameter. + * + * The parameter \c covarianceCoefficient is a multiplying factor of + * \c covaraince and is treated as a random variable (i.e. it is solved for + * in a statistical inversion). + */ + GaussianLikelihoodFullCovarianceRandomCoefficient(const char * prefix, + const VectorSet & domainSet, const V & observations, + const M & covariance); + + //! Destructor + virtual ~GaussianLikelihoodFullCovarianceRandomCoefficient(); + //@} + + //! Actual value of the scalar function. + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + + //! Logarithm of the value of the scalar function. + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + +private: + double m_covarianceCoefficient; + const M & m_covariance; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LIKELIHOOD_FULL_COV_RAND_COEFF_H diff --git a/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C b/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C new file mode 100644 index 000000000..65ef1708a --- /dev/null +++ b/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C @@ -0,0 +1,95 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include + +namespace QUESO { + +template +GaussianLikelihoodFullCovarianceRandomCoefficient::GaussianLikelihoodFullCovarianceRandomCoefficient( + const char * prefix, const VectorSet & domainSet, + const V & observations, const M & covariance) + : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covariance(covariance) +{ + if (covariance.numRowsLocal() != observations.sizeLocal()) { + queso_error_msg("Covariance matrix not same size as observation vector"); + } + + if (domainSet.vectorSpace().dimLocal() != observations.sizeLocal() + 1) { + queso_error_msg("Vector space must have dimension one larger than observation vector"); + } +} + +template +GaussianLikelihoodFullCovarianceRandomCoefficient::~GaussianLikelihoodFullCovarianceRandomCoefficient() +{ +} + +template +double +GaussianLikelihoodFullCovarianceRandomCoefficient::actualValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); +} + +template +double +GaussianLikelihoodFullCovarianceRandomCoefficient::lnValue(const V & domainVector, + const V * domainDirection, V * gradVector, M * hessianMatrix, + V * hessianEffect) const +{ + V modelOutput(this->m_observations, 0, 0); // At least it's not a copy + V weightedMisfit(this->m_observations, 0, 0); // At least it's not a copy + + this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector, + hessianMatrix, hessianEffect); + + // Compute misfit G(x) - y + modelOutput -= this->m_observations; + + // Solve \Sigma u = G(x) - y for u + this->m_covariance.invertMultiply(modelOutput, weightedMisfit); + + // Compute (G(x) - y)^T \Sigma^{-1} (G(x) - y) + modelOutput *= weightedMisfit; + + // This is square of 2-norm + double norm2_squared = modelOutput.sumOfComponents(); + + // The last element of domainVector is the multiplicative coefficient of the + // covariance matrix + return -0.5 * norm2_squared / (domainVector[domainVector.sizeLocal()-1]); +} + +} // End namespace QUESO + +template class QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient; From 3107856631537d806545a7e3b69fcc15aca79d45 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 15:31:04 -0600 Subject: [PATCH 60/99] Adding full cov Gaussian llhood with hyperparam The hyperparameter is the multiplicative coefficient of the observational error covariance matrix. --- .gitignore | 1 + examples/Makefile.am | 6 + .../fullCovarianceRandomCoefficient.C | 137 ++++++++++++++++++ src/stats/inc/GaussianLikelihood.h | 16 +- ...ikelihoodFullCovarianceRandomCoefficient.C | 16 +- 5 files changed, 162 insertions(+), 14 deletions(-) create mode 100644 examples/gaussian_likelihoods/fullCovarianceRandomCoefficient.C diff --git a/.gitignore b/.gitignore index 175b77cf7..db08dde73 100644 --- a/.gitignore +++ b/.gitignore @@ -87,6 +87,7 @@ examples/scalarCovariance examples/diagonalCovariance examples/fullCovariance examples/blockDiagonalCovariance +examples/fullCovarianceRandomCoefficient src/core/inc/queso.h src/libqueso.la diff --git a/examples/Makefile.am b/examples/Makefile.am index 2128a3152..ab44c1c81 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -394,6 +394,12 @@ blockDiagonalCovariance_SOURCES = gaussian_likelihoods/blockDiagonalCovariance.C blockDiagonalCovariance_LDADD = $(top_builddir)/src/libqueso.la blockDiagonalCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/blockDiagonalCovariance $(QUESO_CPPFLAGS) +fullCovarianceRandomCoefficientdir = $(prefix)/examples/gaussian_likelihoods +fullCovarianceRandomCoefficient_PROGRAMS = fullCovarianceRandomCoefficient +fullCovarianceRandomCoefficient_SOURCES = gaussian_likelihoods/fullCovarianceRandomCoefficient.C +fullCovarianceRandomCoefficient_LDADD = $(top_builddir)/src/libqueso.la +fullCovarianceRandomCoefficient_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/fullCovarianceRandomCoefficient $(QUESO_CPPFLAGS) + dist_gpmsa_scalar_DATA = dist_gpmsa_scalar_DATA += ${gpmsa_scalar_SOURCES} diff --git a/examples/gaussian_likelihoods/fullCovarianceRandomCoefficient.C b/examples/gaussian_likelihoods/fullCovarianceRandomCoefficient.C new file mode 100644 index 000000000..9dda05692 --- /dev/null +++ b/examples/gaussian_likelihoods/fullCovarianceRandomCoefficient.C @@ -0,0 +1,137 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include +#include +#include + +template +class Likelihood : public QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient +{ +public: + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const M & covariance) + : QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient(prefix, + domain, observations, covariance) + { + // Default covariance coefficient is 1.0 + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // domainVector is of size 2 because the first element is the model + // parameter and the second (last) element is the multiplicative + // coefficient of the observational error covariance matrix. Therefore, + // for calling the model code, we need only concern ourselves with the + // first element of domainVector. + + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = 1.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, argv[1], "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 2, NULL); + + double min_val = 0.0; + double max_val = 1.0; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + + // Model parameter between 0 and 1 + paramMins[0] = 0.0; + paramMaxs[0] = 1.0; + + // Hyperparameter (multiplicative coefficient of observational error + // covariance matrix) between 0.0 and \infty + paramMins[1] = 0.0; + paramMaxs[1] = INFINITY; + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + + // Fill up covariance 'matrix' + QUESO::GslMatrix covariance(obsSpace.zeroVector()); + covariance(0, 0) = 1.0; + covariance(0, 1) = 0.0; + covariance(1, 0) = 0.0; + covariance(1, 1) = 1.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + QUESO::GenericVectorRV + postRv("post_", paramSpace); + + QUESO::StatisticalInverseProblem + ip("", NULL, priorRv, lhood, postRv); + + QUESO::GslVector paramInitials(paramSpace.zeroVector()); + + paramInitials[0] = 0.0; + + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); + + for (unsigned int i = 0; i < 1; i++) { + proposalCovMatrix(i, i) = 0.1; + } + + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); + + MPI_Finalize(); + + return 0; +} diff --git a/src/stats/inc/GaussianLikelihood.h b/src/stats/inc/GaussianLikelihood.h index 69dd6149a..f736c19f9 100644 --- a/src/stats/inc/GaussianLikelihood.h +++ b/src/stats/inc/GaussianLikelihood.h @@ -62,10 +62,18 @@ class BaseGaussianLikelihood : public BaseScalarFunction { //! Evaluates the user's model at the point \c domainVector /*! * This is pure virtual, so the user must implement this when subclassing a - * Gaussian likelihood class. Note that, what is returned is void. The user - * will fill up the \c modelOutput vector with output from the model. - * This represents a vector of synthetic observations that will be to compare - * to actual observations when computing the likelihood functional. + * Gaussian likelihood class. Note that void is returned. The user will + * fill up the \c modelOutput vector with output from the model. This + * represents a vector of synthetic observations that will be to compare to + * actual observations when computing the likelihood functional. + * + * The first \c n components of \c domainVector are the model parameters. + * The rest of \c domainVector contains the hyperparameters, if any. For + * example, in \c GaussianLikelihoodFullCovarainceRandomCoefficient, the last + * component of \c domainVector contains the multiplicative coefficient of + * the observational covariance matrix. In this case, the user need not + * concern themselves with this parameter as it is handled not in the model + * evaluation but by the likelihood evaluation. */ virtual void evaluateModel(const V & domainVector, const V * domainDirection, V & modelOutput, V * gradVector, M * hessianMatrix, diff --git a/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C b/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C index 65ef1708a..8d76d4d04 100644 --- a/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C +++ b/src/stats/src/GaussianLikelihoodFullCovarianceRandomCoefficient.C @@ -40,10 +40,6 @@ GaussianLikelihoodFullCovarianceRandomCoefficient::GaussianLikelihoodFullC if (covariance.numRowsLocal() != observations.sizeLocal()) { queso_error_msg("Covariance matrix not same size as observation vector"); } - - if (domainSet.vectorSpace().dimLocal() != observations.sizeLocal() + 1) { - queso_error_msg("Vector space must have dimension one larger than observation vector"); - } } template @@ -53,9 +49,9 @@ GaussianLikelihoodFullCovarianceRandomCoefficient::~GaussianLikelihoodFull template double -GaussianLikelihoodFullCovarianceRandomCoefficient::actualValue(const V & domainVector, - const V * domainDirection, V * gradVector, M * hessianMatrix, - V * hessianEffect) const +GaussianLikelihoodFullCovarianceRandomCoefficient::actualValue( + const V & domainVector, const V * domainDirection, V * gradVector, + M * hessianMatrix, V * hessianEffect) const { return std::exp(this->lnValue(domainVector, domainDirection, gradVector, hessianMatrix, hessianEffect)); @@ -63,9 +59,9 @@ GaussianLikelihoodFullCovarianceRandomCoefficient::actualValue(const V & d template double -GaussianLikelihoodFullCovarianceRandomCoefficient::lnValue(const V & domainVector, - const V * domainDirection, V * gradVector, M * hessianMatrix, - V * hessianEffect) const +GaussianLikelihoodFullCovarianceRandomCoefficient::lnValue( + const V & domainVector, const V * domainDirection, V * gradVector, + M * hessianMatrix, V * hessianEffect) const { V modelOutput(this->m_observations, 0, 0); // At least it's not a copy V weightedMisfit(this->m_observations, 0, 0); // At least it's not a copy From c694525d508a3bc8ec99d2af71fb0131f24d1712 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 16:05:42 -0600 Subject: [PATCH 61/99] Adding test for random coefficient in the likelihood --- .gitignore | 1 + test/Makefile.am | 4 + .../test_fullCovarianceRandomCoefficient.C | 134 ++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 test/test_gaussian_likelihoods/test_fullCovarianceRandomCoefficient.C diff --git a/.gitignore b/.gitignore index db08dde73..2a233aa6e 100644 --- a/.gitignore +++ b/.gitignore @@ -175,3 +175,4 @@ test/test_blockDiagonalCovariance test/test_output_gaussian_likelihoods test/test_gaussian_likelihoods/queso_input.txt test/test_GslBlockMatrixInvertMultiply +test/test_fullCovarianceRandomCoefficient diff --git a/test/Makefile.am b/test/Makefile.am index 511705da3..2d99d2d9a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -40,6 +40,7 @@ check_PROGRAMS += test_diagonalCovariance check_PROGRAMS += test_fullCovariance check_PROGRAMS += test_blockDiagonalCovariance check_PROGRAMS += test_GslBlockMatrixInvertMultiply +check_PROGRAMS += test_fullCovarianceRandomCoefficient LDADD = $(top_builddir)/src/libqueso.la @@ -105,6 +106,7 @@ test_diagonalCovariance_SOURCES = test_gaussian_likelihoods/test_diagonalCovaria test_fullCovariance_SOURCES = test_gaussian_likelihoods/test_fullCovariance.C test_blockDiagonalCovariance_SOURCES = test_gaussian_likelihoods/test_blockDiagonalCovariance.C test_GslBlockMatrixInvertMultiply_SOURCES = test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C +test_fullCovarianceRandomCoefficient_SOURCES = test_gaussian_likelihoods/test_fullCovarianceRandomCoefficient.C # Files to freedom stamp srcstamp = @@ -142,6 +144,7 @@ srcstamp += $(test_diagonalCovariance_SOURCES) srcstamp += $(test_fullCovariance_SOURCES) srcstamp += $(test_blockDiagonalCovariance_SOURCES) srcstamp += $(test_GslBlockMatrixInvertMultiply_SOURCES) +srcstamp += $(test_fullCovarianceRandomCoefficient_SOURCES) TESTS = TESTS += $(top_builddir)/test/test_uqEnvironmentCopy @@ -179,6 +182,7 @@ TESTS += $(top_builddir)/test/test_diagonalCovariance TESTS += $(top_builddir)/test/test_fullCovariance TESTS += $(top_builddir)/test/test_blockDiagonalCovariance TESTS += $(top_builddir)/test/test_GslBlockMatrixInvertMultiply +TESTS += $(top_builddir)/test/test_fullCovarianceRandomCoefficient XFAIL_TESTS = $(top_builddir)/test/test_SequenceOfVectorsErase diff --git a/test/test_gaussian_likelihoods/test_fullCovarianceRandomCoefficient.C b/test/test_gaussian_likelihoods/test_fullCovarianceRandomCoefficient.C new file mode 100644 index 000000000..14608c262 --- /dev/null +++ b/test/test_gaussian_likelihoods/test_fullCovarianceRandomCoefficient.C @@ -0,0 +1,134 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include + +#define TOL 1e-8 + +template +class Likelihood : public QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const M & covariance) + : QUESO::GaussianLikelihoodFullCovarianceRandomCoefficient(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + // Only handle element 0. Element 1 is the hyperparameter + modelOutput[i] = domainVector[0] + 3.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "test_gaussian_likelihoods/queso_input.txt", "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 2, NULL); + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + + // Bounds for model parameter + paramMins[0] = 0.0; + paramMaxs[0] = 1.0; + + // Bounds for hyperparameter (multiplicative coefficient of observational + // error covariance matrix) + paramMins[1] = 0.0; + paramMaxs[1] = INFINITY; + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 2, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + + // Fill up covariance 'matrix' + QUESO::GslMatrix covariance(obsSpace.zeroVector()); + covariance(0, 0) = 1.0; + covariance(0, 1) = 2.0; + covariance(1, 0) = 2.0; + covariance(1, 1) = 8.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + double lhood_value; + double truth_value; + QUESO::GslVector point(paramSpace.zeroVector()); + point[0] = 0.0; + point[1] = 2.0; // Multiplicative coefficient of obs matrix + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = std::exp(-5.0/4.0); + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Random coefficient Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + point[0] = -2.0; + point[1] = 1.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = 1.0; + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Random coefficient Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + MPI_Finalize(); + + return 0; +} From 0ab825a2abeac9ea989e860e3c91429d80839c9a Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 17:32:51 -0600 Subject: [PATCH 62/99] Adding classes for Gaussian block llhd with random coeffs --- inc/queso/Makefile.am | 3 + src/Makefile.am | 2 + ...lockDiagonalCovarianceRandomCoefficients.h | 83 +++++++++++++ ...lockDiagonalCovarianceRandomCoefficients.C | 113 ++++++++++++++++++ 4 files changed, 201 insertions(+) create mode 100644 src/stats/inc/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h create mode 100644 src/stats/src/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.C diff --git a/inc/queso/Makefile.am b/inc/queso/Makefile.am index 80af5c724..17878cd8a 100644 --- a/inc/queso/Makefile.am +++ b/inc/queso/Makefile.am @@ -108,6 +108,7 @@ BUILT_SOURCES += GammaVectorRealizer.h BUILT_SOURCES += GaussianJointPdf.h BUILT_SOURCES += GaussianLikelihood.h BUILT_SOURCES += GaussianLikelihoodBlockDiagonalCovariance.h +BUILT_SOURCES += GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h BUILT_SOURCES += GaussianLikelihoodDiagonalCovariance.h BUILT_SOURCES += GaussianLikelihoodFullCovariance.h BUILT_SOURCES += GaussianLikelihoodScalarCovariance.h @@ -386,6 +387,8 @@ GaussianLikelihood.h: $(top_srcdir)/src/stats/inc/GaussianLikelihood.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodBlockDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ +GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h + $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodDiagonalCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodDiagonalCovariance.h $(AM_V_GEN)rm -f $@ && $(LN_S) $< $@ GaussianLikelihoodFullCovariance.h: $(top_srcdir)/src/stats/inc/GaussianLikelihoodFullCovariance.h diff --git a/src/Makefile.am b/src/Makefile.am index 73edbde1c..287d9b09f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -242,6 +242,7 @@ libqueso_la_SOURCES += stats/src/GaussianLikelihoodScalarCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodDiagonalCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodFullCovariance.C libqueso_la_SOURCES += stats/src/GaussianLikelihoodBlockDiagonalCovariance.C +libqueso_la_SOURCES += stats/src/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.C # Sources from gp/src @@ -430,6 +431,7 @@ libqueso_include_HEADERS += stats/inc/GaussianLikelihoodScalarCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodDiagonalCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodFullCovariance.h libqueso_include_HEADERS += stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h +libqueso_include_HEADERS += stats/inc/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h # Headers to install from gp/inc diff --git a/src/stats/inc/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h new file mode 100644 index 000000000..9222a9ae7 --- /dev/null +++ b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h @@ -0,0 +1,83 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#ifndef UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_RAND_COEFFS_H +#define UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_RAND_COEFFS_H + +#include +#include + +namespace QUESO { + +/*! + * \file GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.h + * + * \class GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients + * \brief A class representing a Gaussian likelihood with block-diagonal covariance matrix + */ + +template +class GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients : public BaseGaussianLikelihood { +public: + //! @name Constructor/Destructor methods. + //@{ + //! Default constructor. + /*! + * Instantiates a Gaussian likelihood function, given a prefix, its domain, a + * vector of observations and a block diagonal covariance matrix. + * The diagonal covariance matrix is of type \c GslBlockMatrix. Each block + * in the block diagonal matrix is an object of type \c GslMatrix. + */ + GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(const char * prefix, + const VectorSet & domainSet, const V & observations, + const GslBlockMatrix & covariance); + + //! Destructor + virtual ~GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(); + //@} + + //! Actual value of the scalar function. + virtual double actualValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + + //! Logarithm of the value of the scalar function. + /*! + * The last \c n elements of \c domainVector, where \c n is the number of + * blocks in the block diagonal covariance matrix, are treated as + * hyperparameters and will be sample in a statistical inversion. + * + * The user need not concern themselves with handling these in the model + * evaluation routine, since they are handled by the likelihood evaluation + * routine. + */ + virtual double lnValue(const V & domainVector, const V * domainDirection, + V * gradVector, M * hessianMatrix, V * hessianEffect) const; + +private: + const GslBlockMatrix & m_covariance; +}; + +} // End namespace QUESO + +#endif // UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_RAND_COEFFS_H diff --git a/src/stats/src/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.C b/src/stats/src/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.C new file mode 100644 index 000000000..43cfb3614 --- /dev/null +++ b/src/stats/src/GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients.C @@ -0,0 +1,113 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include + +namespace QUESO { + +template +GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients( + const char * prefix, const VectorSet & domainSet, + const V & observations, const GslBlockMatrix & covariance) + : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covariance(covariance) +{ + unsigned int totalDim = 0; + + for (unsigned int i = 0; i < this->m_covariance.numBlocks(); i++) { + totalDim += this->m_covariance.getBlock(i).numRowsLocal(); + } + + if (totalDim != observations.sizeLocal()) { + queso_error_msg("Covariance matrix not same dimension as observation vector"); + } +} + +template +GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients::~GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients() +{ +} + +template +double +GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients::actualValue( + const V & domainVector, const V * domainDirection, V * gradVector, + M * hessianMatrix, V * hessianEffect) const +{ + return std::exp(this->lnValue(domainVector, domainDirection, gradVector, + hessianMatrix, hessianEffect)); +} + +template +double +GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients::lnValue( + const V & domainVector, const V * domainDirection, V * gradVector, + M * hessianMatrix, V * hessianEffect) const +{ + V modelOutput(this->m_observations, 0, 0); // At least it's not a copy + V weightedMisfit(this->m_observations, 0, 0); // At least it's not a copy + + this->evaluateModel(domainVector, domainDirection, modelOutput, gradVector, + hessianMatrix, hessianEffect); + + // Compute misfit G(x) - y + modelOutput -= this->m_observations; + + // Solve \Sigma u = G(x) - y for u + this->m_covariance.invertMultiply(modelOutput, weightedMisfit); + + // Deal with the multiplicative coefficients for each of the blocks + unsigned int numBlocks = this->m_covariance.numBlocks(); + unsigned int offset = 0; + + // For each block... + for (unsigned int i = 0; i < this->m_covariance.numBlocks(); i++) { + + // ...find the right hyperparameter + unsigned int index = domainVector.sizeLocal() + (i - numBlocks); + double coefficient = domainVector[index]; + + // ...divide the appropriate parts of the solution by the coefficient + unsigned int blockDim = this->m_covariance.getBlock(i).numRowsLocal(); + for (unsigned int j = 0; j < blockDim; j++) { + // 'coefficient' is a variance, so we divide by it + modelOutput[offset+j] /= coefficient; + } + offset += blockDim; + } + + // Compute (G(x) - y)^T \Sigma^{-1} (G(x) - y) + modelOutput *= weightedMisfit; + + double norm2_squared = modelOutput.sumOfComponents(); // This is square of 2-norm + + return -0.5 * norm2_squared; +} + +} // End namespace QUESO + +template class QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients; From 11bd8e28dd9091c5bde129c95c2492320b12ed82 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 17:55:56 -0600 Subject: [PATCH 63/99] Adding test for random block diag coefficients --- .gitignore | 1 + test/Makefile.am | 4 + ...lockDiagonalCovarianceRandomCoefficients.C | 145 ++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 test/test_gaussian_likelihoods/test_blockDiagonalCovarianceRandomCoefficients.C diff --git a/.gitignore b/.gitignore index 175b77cf7..b498e84cb 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,4 @@ test/test_blockDiagonalCovariance test/test_output_gaussian_likelihoods test/test_gaussian_likelihoods/queso_input.txt test/test_GslBlockMatrixInvertMultiply +test/test_blockDiagonalCovarianceRandomCoefficients diff --git a/test/Makefile.am b/test/Makefile.am index 511705da3..b75256a9a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -40,6 +40,7 @@ check_PROGRAMS += test_diagonalCovariance check_PROGRAMS += test_fullCovariance check_PROGRAMS += test_blockDiagonalCovariance check_PROGRAMS += test_GslBlockMatrixInvertMultiply +check_PROGRAMS += test_blockDiagonalCovarianceRandomCoefficients LDADD = $(top_builddir)/src/libqueso.la @@ -105,6 +106,7 @@ test_diagonalCovariance_SOURCES = test_gaussian_likelihoods/test_diagonalCovaria test_fullCovariance_SOURCES = test_gaussian_likelihoods/test_fullCovariance.C test_blockDiagonalCovariance_SOURCES = test_gaussian_likelihoods/test_blockDiagonalCovariance.C test_GslBlockMatrixInvertMultiply_SOURCES = test_GslBlockMatrix/test_GslBlockMatrixInvertMultiply.C +test_blockDiagonalCovarianceRandomCoefficients_SOURCES = test_gaussian_likelihoods/test_blockDiagonalCovarianceRandomCoefficients.C # Files to freedom stamp srcstamp = @@ -142,6 +144,7 @@ srcstamp += $(test_diagonalCovariance_SOURCES) srcstamp += $(test_fullCovariance_SOURCES) srcstamp += $(test_blockDiagonalCovariance_SOURCES) srcstamp += $(test_GslBlockMatrixInvertMultiply_SOURCES) +srcstamp += $(test_blockDiagonalCovarianceRandomCoefficients_SOURCES) TESTS = TESTS += $(top_builddir)/test/test_uqEnvironmentCopy @@ -179,6 +182,7 @@ TESTS += $(top_builddir)/test/test_diagonalCovariance TESTS += $(top_builddir)/test/test_fullCovariance TESTS += $(top_builddir)/test/test_blockDiagonalCovariance TESTS += $(top_builddir)/test/test_GslBlockMatrixInvertMultiply +TESTS += $(top_builddir)/test/test_blockDiagonalCovarianceRandomCoefficients XFAIL_TESTS = $(top_builddir)/test/test_SequenceOfVectorsErase diff --git a/test/test_gaussian_likelihoods/test_blockDiagonalCovarianceRandomCoefficients.C b/test/test_gaussian_likelihoods/test_blockDiagonalCovarianceRandomCoefficients.C new file mode 100644 index 000000000..44b434058 --- /dev/null +++ b/test/test_gaussian_likelihoods/test_blockDiagonalCovarianceRandomCoefficients.C @@ -0,0 +1,145 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include + +#define TOL 1e-8 + +template +class Likelihood : public QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const QUESO::GslBlockMatrix & covariance) + : QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = domainVector[0] + 3.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, "test_gaussian_likelihoods/queso_input.txt", "", NULL); + + QUESO::VectorSpace paramSpace(env, + "param_", 3, NULL); + + double min_val = 0.0; + double max_val = INFINITY; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + + // Hyperparameter bounds + paramMins.cwSet(min_val); + paramMaxs.cwSet(max_val); + + // Model parameter bounds + paramMaxs[0] = 1.0; + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 3, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + observations[2] = 1.0; + + // Set up block sizes for observation covariance matrix + std::vector blockSizes(2); + blockSizes[0] = 1; // First block is 1x1 (scalar) + blockSizes[1] = 2; // Second block is 2x2 + + // Set up block (identity) matrix with specified block sizes + QUESO::GslBlockMatrix covariance(blockSizes, observations, 1.0); + + covariance.getBlock(0)(0, 0) = 1.0; + covariance.getBlock(1)(0, 0) = 1.0; + covariance.getBlock(1)(0, 1) = 2.0; + covariance.getBlock(1)(1, 0) = 2.0; + covariance.getBlock(1)(1, 1) = 8.0; + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + double lhood_value; + double truth_value; + QUESO::GslVector point(paramSpace.zeroVector()); + point[0] = 0.0; + point[1] = 4.0; + point[2] = 2.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = std::exp(-1.75); + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Random coefficient Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + point[0] = -2.0; + point[1] = 1.0; + point[2] = 1.0; + lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); + truth_value = 1.0; + + if (std::abs(lhood_value - truth_value) > TOL) { + std::cerr << "Random coefficient Gaussian test case failure." << std::endl; + std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; + std::cerr << "Likelihood value should be: " << truth_value << std::endl; + queso_error(); + } + + MPI_Finalize(); + + return 0; +} From 1b50e2a7853013e0d3675cfbb65d027388587a09 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 18:08:21 -0600 Subject: [PATCH 64/99] Adding example for block random coefficients --- .gitignore | 1 + examples/Makefile.am | 6 + ...lockDiagonalCovarianceRandomCoefficients.C | 133 ++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 examples/gaussian_likelihoods/blockDiagonalCovarianceRandomCoefficients.C diff --git a/.gitignore b/.gitignore index b498e84cb..beb23e625 100644 --- a/.gitignore +++ b/.gitignore @@ -87,6 +87,7 @@ examples/scalarCovariance examples/diagonalCovariance examples/fullCovariance examples/blockDiagonalCovariance +examples/blockDiagonalCovarianceRandomCoefficients src/core/inc/queso.h src/libqueso.la diff --git a/examples/Makefile.am b/examples/Makefile.am index 2128a3152..325a8951a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -394,6 +394,12 @@ blockDiagonalCovariance_SOURCES = gaussian_likelihoods/blockDiagonalCovariance.C blockDiagonalCovariance_LDADD = $(top_builddir)/src/libqueso.la blockDiagonalCovariance_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/blockDiagonalCovariance $(QUESO_CPPFLAGS) +blockDiagonalCovarianceRandomCoefficientsdir = $(prefix)/examples/gaussian_likelihoods +blockDiagonalCovarianceRandomCoefficients_PROGRAMS = blockDiagonalCovarianceRandomCoefficients +blockDiagonalCovarianceRandomCoefficients_SOURCES = gaussian_likelihoods/blockDiagonalCovarianceRandomCoefficients.C +blockDiagonalCovarianceRandomCoefficients_LDADD = $(top_builddir)/src/libqueso.la +blockDiagonalCovarianceRandomCoefficients_CPPFLAGS = -I$(top_srcdir)/examples/gaussian_likelihoods/blockDiagonalCovarianceRandomCoefficients $(QUESO_CPPFLAGS) + dist_gpmsa_scalar_DATA = dist_gpmsa_scalar_DATA += ${gpmsa_scalar_SOURCES} diff --git a/examples/gaussian_likelihoods/blockDiagonalCovarianceRandomCoefficients.C b/examples/gaussian_likelihoods/blockDiagonalCovarianceRandomCoefficients.C new file mode 100644 index 000000000..480f3b5e5 --- /dev/null +++ b/examples/gaussian_likelihoods/blockDiagonalCovarianceRandomCoefficients.C @@ -0,0 +1,133 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// QUESO - a library to support the Quantification of Uncertainty +// for Estimation, Simulation and Optimization +// +// Copyright (C) 2008-2015 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +class Likelihood : public QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients +{ +public: + + Likelihood(const char * prefix, const QUESO::VectorSet & domain, + const V & observations, const QUESO::GslBlockMatrix & covariance) + : QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(prefix, domain, + observations, covariance) + { + } + + virtual ~Likelihood() + { + } + + virtual void evaluateModel(const V & domainVector, const V * domainDirection, + V & modelOutput, V * gradVector, M * hessianMatrix, + V * hessianEffect) const + { + // Evaluate model and fill up the m_modelOutput member variable + for (unsigned int i = 0; i < modelOutput.sizeLocal(); i++) { + modelOutput[i] = 1.0; + } + } +}; + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + QUESO::FullEnvironment env(MPI_COMM_WORLD, argv[1], "", NULL); + + // Need 3 dims because two are for the hyperparameters + QUESO::VectorSpace paramSpace(env, + "param_", 3, NULL); + + double min_val = 0.0; + double max_val = INFINITY; + + QUESO::GslVector paramMins(paramSpace.zeroVector()); + QUESO::GslVector paramMaxs(paramSpace.zeroVector()); + + // Hyperparameter bounds + paramMins.cwSet(min_val); + paramMaxs.cwSet(max_val); + + // Model parameter bounds + paramMaxs[0] = 1.0; + + QUESO::BoxSubset paramDomain("param_", + paramSpace, paramMins, paramMaxs); + + QUESO::UniformVectorRV priorRv("prior_", + paramDomain); + + // Set up observation space + QUESO::VectorSpace obsSpace(env, + "obs_", 3, NULL); + + // Fill up observation vector + QUESO::GslVector observations(obsSpace.zeroVector()); + observations[0] = 1.0; + observations[1] = 1.0; + observations[2] = 1.0; + + // Set up block sizes for observation covariance matrix + std::vector blockSizes(2); + blockSizes[0] = 1; // First block is 1x1 (scalar) + blockSizes[1] = 2; // Second block is 2x2 + + // Set up block matrix (identity matrix) with specified block sizes + QUESO::GslBlockMatrix covariance(blockSizes, observations, 1.0); + + // Pass in observations to Gaussian likelihood object + Likelihood lhood("llhd_", paramDomain, + observations, covariance); + + QUESO::GenericVectorRV + postRv("post_", paramSpace); + + QUESO::StatisticalInverseProblem + ip("", NULL, priorRv, lhood, postRv); + + QUESO::GslVector paramInitials(paramSpace.zeroVector()); + + paramInitials[0] = 0.0; + + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); + + for (unsigned int i = 0; i < 1; i++) { + proposalCovMatrix(i, i) = 0.1; + } + + ip.solveWithBayesMetropolisHastings(NULL, paramInitials, &proposalCovMatrix); + + MPI_Finalize(); + + return 0; +} From 70c2fafe0c6fc48c7022aa62e92136631da6d1c1 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Fri, 6 Mar 2015 22:21:14 -0600 Subject: [PATCH 65/99] Add multiplicative coefficients to block diag cov matrix --- ...aussianLikelihoodBlockDiagonalCovariance.h | 11 +++++++ ...aussianLikelihoodBlockDiagonalCovariance.C | 31 +++++++++++++++++++ .../test_blockDiagonalCovariance.C | 12 +++++-- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h index fac06daf3..2578f4d73 100644 --- a/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h +++ b/src/stats/inc/GaussianLikelihoodBlockDiagonalCovariance.h @@ -25,6 +25,7 @@ #ifndef UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_H #define UQ_GAUSSIAN_LIKELIHOOD_BLOCK_DIAG_COV_H +#include #include #include @@ -48,6 +49,9 @@ class GaussianLikelihoodBlockDiagonalCovariance : public BaseGaussianLikelihood< * vector of observations and a block diagonal covariance matrix. * The diagonal covariance matrix is of type \c GslBlockMatrix. Each block * in the block diagonal matrix is an object of type \c GslMatrix. + * + * Furthermore, each block comes with a multiplicative coefficient which + * defaults to 1.0. */ GaussianLikelihoodBlockDiagonalCovariance(const char * prefix, const VectorSet & domainSet, const V & observations, @@ -57,6 +61,12 @@ class GaussianLikelihoodBlockDiagonalCovariance : public BaseGaussianLikelihood< virtual ~GaussianLikelihoodBlockDiagonalCovariance(); //@} + //! Get (non-const) multiplicative coefficient for block \c i + double & blockCoefficient(unsigned int i); + + //! Get (const) multiplicative coefficient for block \c i + const double & getBlockCoefficient(unsigned int i) const; + //! Actual value of the scalar function. virtual double actualValue(const V & domainVector, const V * domainDirection, V * gradVector, M * hessianMatrix, V * hessianEffect) const; @@ -66,6 +76,7 @@ class GaussianLikelihoodBlockDiagonalCovariance : public BaseGaussianLikelihood< V * gradVector, M * hessianMatrix, V * hessianEffect) const; private: + std::vector m_covarianceCoefficients; const GslBlockMatrix & m_covariance; }; diff --git a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C index f3eff2621..af91feaa1 100644 --- a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C +++ b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C @@ -34,6 +34,7 @@ GaussianLikelihoodBlockDiagonalCovariance::GaussianLikelihoodBlockDiagonal const char * prefix, const VectorSet & domainSet, const V & observations, const GslBlockMatrix & covariance) : BaseGaussianLikelihood(prefix, domainSet, observations), + m_covarianceCoefficients(covariance.numBlocks(), 1.0), m_covariance(covariance) { unsigned int totalDim = 0; @@ -52,6 +53,22 @@ GaussianLikelihoodBlockDiagonalCovariance::~GaussianLikelihoodBlockDiagona { } +template +double & +GaussianLikelihoodBlockDiagonalCovariance::blockCoefficient( + unsigned int i) +{ + return this->m_covarianceCoefficients[i]; +} + +template +const double & +GaussianLikelihoodBlockDiagonalCovariance::getBlockCoefficient( + unsigned int i) const +{ + return this->m_covarianceCoefficients[i]; +} + template double GaussianLikelihoodBlockDiagonalCovariance::actualValue( @@ -80,6 +97,20 @@ GaussianLikelihoodBlockDiagonalCovariance::lnValue( // Solve \Sigma u = G(x) - y for u this->m_covariance.invertMultiply(modelOutput, weightedMisfit); + // Deal with the multiplicative coefficients for each of the blocks + unsigned int offset = 0; + + // For each block... + for (unsigned int i = 0; i < this->m_covariance.numBlocks(); i++) { + // ...divide the appropriate parts of the solution by the coefficient + unsigned int blockDim = this->m_covariance.getBlock(i).numRowsLocal(); + for (unsigned int j = 0; j < blockDim; j++) { + // coefficient is a variance, so we divide by it + modelOutput[offset+j] /= this->m_covarianceCoefficients[i]; + } + offset += blockDim; + } + // Compute (G(x) - y)^T \Sigma^{-1} (G(x) - y) modelOutput *= weightedMisfit; diff --git a/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C b/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C index 57ad41c24..0838d9b12 100644 --- a/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C +++ b/test/test_gaussian_likelihoods/test_blockDiagonalCovariance.C @@ -105,26 +105,32 @@ int main(int argc, char ** argv) { Likelihood lhood("llhd_", paramDomain, observations, covariance); + lhood.blockCoefficient(0) = 4.0; + lhood.blockCoefficient(1) = 2.0; + double lhood_value; double truth_value; QUESO::GslVector point(paramSpace.zeroVector()); point[0] = 0.0; lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); - truth_value = std::exp(-4.5); + truth_value = std::exp(-1.75); if (std::abs(lhood_value - truth_value) > TOL) { - std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Block diagonal Gaussian test case failure." << std::endl; std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; std::cerr << "Likelihood value should be: " << truth_value << std::endl; queso_error(); } + lhood.blockCoefficient(0) = 1.0; + lhood.blockCoefficient(1) = 1.0; + point[0] = -2.0; lhood_value = lhood.actualValue(point, NULL, NULL, NULL, NULL); truth_value = 1.0; if (std::abs(lhood_value - truth_value) > TOL) { - std::cerr << "Scalar Gaussian test case failure." << std::endl; + std::cerr << "Block diagonal Gaussian test case failure." << std::endl; std::cerr << "Computed likelihood value is: " << lhood_value << std::endl; std::cerr << "Likelihood value should be: " << truth_value << std::endl; queso_error(); From 8d63414cd9d64adbd8cc50e498962dd12166ab16 Mon Sep 17 00:00:00 2001 From: Brian Adams Date: Mon, 9 Mar 2015 22:20:50 -0600 Subject: [PATCH 66/99] Add accessors for chain, log-likelihood and log-target sequences. Allow C++ clients access to stored sequences for use in post-processing and output. --- src/stats/inc/StatisticalInverseProblem.h | 12 +++++++++ src/stats/src/StatisticalInverseProblem.C | 33 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/src/stats/inc/StatisticalInverseProblem.h b/src/stats/inc/StatisticalInverseProblem.h index ef1e8eb25..ea67d37c0 100644 --- a/src/stats/inc/StatisticalInverseProblem.h +++ b/src/stats/inc/StatisticalInverseProblem.h @@ -176,6 +176,18 @@ class StatisticalInverseProblem /*! The Posterior RV contains the solution of the Bayes problem.*/ const GenericVectorRV& postRv () const; + //! Returns the MCMC chain; access to private attribute m_chain. + /*! Only valid after solve has been called.*/ + const BaseVectorSequence& chain() const; + + //! Returns log likelihood values; access to private attribute m_logLikelihoodValues. + /*! Only valid for MH and only after solve has been called.*/ + const ScalarSequence& logLikelihoodValues() const; + + //! Returns log target values; access to private attribute m_logTargetValues. + /*! Only valid for MH and only after solve has been called.*/ + const ScalarSequence& logTargetValues() const; + //! Returns the logarithm value of the evidence. Related to ML. double logEvidence () const; diff --git a/src/stats/src/StatisticalInverseProblem.C b/src/stats/src/StatisticalInverseProblem.C index 34253a680..82569abf9 100644 --- a/src/stats/src/StatisticalInverseProblem.C +++ b/src/stats/src/StatisticalInverseProblem.C @@ -454,6 +454,39 @@ StatisticalInverseProblem::postRv() const } //-------------------------------------------------- template +const BaseVectorSequence& +StatisticalInverseProblem::chain() const +{ + UQ_FATAL_TEST_MACRO(m_chain == NULL, + m_env.worldRank(), + "StatisticalInverseProblem::chain()", + "m_chain is NULL"); + return *m_chain; +} +//-------------------------------------------------- +template +const ScalarSequence& +StatisticalInverseProblem::logLikelihoodValues() const +{ + UQ_FATAL_TEST_MACRO(m_logLikelihoodValues == NULL, + m_env.worldRank(), + "StatisticalInverseProblem::logLikelihoodValues()", + "m_logLikelihoodValues is NULL"); + return *m_logLikelihoodValues; +} +//-------------------------------------------------- +template +const ScalarSequence& +StatisticalInverseProblem::logTargetValues() const +{ + UQ_FATAL_TEST_MACRO(m_logTargetValues == NULL, + m_env.worldRank(), + "StatisticalInverseProblem::logTargetValues()", + "m_logTargetValues is NULL"); + return *m_logTargetValues; +} +//-------------------------------------------------- +template double StatisticalInverseProblem::logEvidence() const { UQ_FATAL_TEST_MACRO(m_mlSampler == NULL, From 2c16bb0b4cd1b470e0b8497df79a2fdf1d923f68 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 9 Mar 2015 20:52:11 -0500 Subject: [PATCH 67/99] Fix MPI install for travis ci --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f85ae080d..4faf0838b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,8 @@ compiler: - clang before_script: - sudo apt-get update -qq - - sudo apt-get install -qq libgsl0-dev libmpich2-dev libboost-all-dev -script: ./bootstrap && ./configure && make && make check + - sudo apt-get install -q build-essential + - sudo apt-get install -q libgsl0-dev + - sudo apt-get install -q openmpi-bin openmpi-dev + - sudo apt-get install -q libboost-all-dev +script: ./bootstrap && CC="mpicc" CXX="mpicxx" ./configure && make -j2 && make check From b6cda89c47e69ddcaaaa9fca8e6be8b3ae167867 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Mon, 9 Mar 2015 22:10:20 -0500 Subject: [PATCH 68/99] Adding missing includes --- examples/gravity/src/gravity_qoi.C | 2 ++ src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C | 2 ++ src/stats/src/GaussianLikelihoodDiagonalCovariance.C | 2 ++ src/stats/src/GaussianLikelihoodFullCovariance.C | 2 ++ src/stats/src/GaussianLikelihoodScalarCovariance.C | 2 ++ src/stats/src/InvLogitGaussianVectorRealizer.C | 2 ++ 6 files changed, 12 insertions(+) diff --git a/examples/gravity/src/gravity_qoi.C b/examples/gravity/src/gravity_qoi.C index 2285c744a..f814a8cb0 100644 --- a/examples/gravity/src/gravity_qoi.C +++ b/examples/gravity/src/gravity_qoi.C @@ -28,6 +28,8 @@ * This file contains the code for the user defined qoi routine. */ +#include + #include #include #include diff --git a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C index f3eff2621..d12bdfd8a 100644 --- a/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C +++ b/src/stats/src/GaussianLikelihoodBlockDiagonalCovariance.C @@ -22,6 +22,8 @@ // //-----------------------------------------------------------------------el- +#include + #include #include #include diff --git a/src/stats/src/GaussianLikelihoodDiagonalCovariance.C b/src/stats/src/GaussianLikelihoodDiagonalCovariance.C index df957baf2..456fbb230 100644 --- a/src/stats/src/GaussianLikelihoodDiagonalCovariance.C +++ b/src/stats/src/GaussianLikelihoodDiagonalCovariance.C @@ -22,6 +22,8 @@ // //-----------------------------------------------------------------------el- +#include + #include #include #include diff --git a/src/stats/src/GaussianLikelihoodFullCovariance.C b/src/stats/src/GaussianLikelihoodFullCovariance.C index 0df1cb141..a51631ae1 100644 --- a/src/stats/src/GaussianLikelihoodFullCovariance.C +++ b/src/stats/src/GaussianLikelihoodFullCovariance.C @@ -22,6 +22,8 @@ // //-----------------------------------------------------------------------el- +#include + #include #include #include diff --git a/src/stats/src/GaussianLikelihoodScalarCovariance.C b/src/stats/src/GaussianLikelihoodScalarCovariance.C index e44679385..191083912 100644 --- a/src/stats/src/GaussianLikelihoodScalarCovariance.C +++ b/src/stats/src/GaussianLikelihoodScalarCovariance.C @@ -22,6 +22,8 @@ // //-----------------------------------------------------------------------el- +#include + #include #include #include diff --git a/src/stats/src/InvLogitGaussianVectorRealizer.C b/src/stats/src/InvLogitGaussianVectorRealizer.C index fe8257c34..c23910360 100644 --- a/src/stats/src/InvLogitGaussianVectorRealizer.C +++ b/src/stats/src/InvLogitGaussianVectorRealizer.C @@ -28,6 +28,8 @@ #include #include +#include + namespace QUESO { template From f78a0389233fca98bb9109eb90ba31550baaa164 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 11 Dec 2014 14:57:35 -0600 Subject: [PATCH 69/99] Remove turd test --- src/stats/test/TestExample.C | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/stats/test/TestExample.C diff --git a/src/stats/test/TestExample.C b/src/stats/test/TestExample.C deleted file mode 100644 index dd4f43f03..000000000 --- a/src/stats/test/TestExample.C +++ /dev/null @@ -1,17 +0,0 @@ -#define BOOST_TEST_MODULE -#include - -int add( int i, int j ) { return i+j; } -int mult( int i, int j ) { return i*j; } - -BOOST_AUTO_TEST_CASE( simple_test_add ) -{ - BOOST_CHECK( add( 2,2 ) == 4 ); // continues on error - BOOST_REQUIRE( add( 2,2 ) == 4 ); // throws on error -} - -BOOST_AUTO_TEST_CASE( simple_test_mult ) -{ - BOOST_CHECK( mult( 2,2 ) == 4 ); // continues on error - BOOST_REQUIRE( mult( 2,2 ) == 4 ); // throws on error -} From ea617bc093f23baf82dfb5297476283b46f4e03c Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 11 Dec 2014 14:58:58 -0600 Subject: [PATCH 70/99] Repurpose old gaussian pdf test --- src/stats/test/TestVectorPdf_gsl.C | 264 ----------------- test/Makefile.am | 4 + .../test_VectorPdf_gsl.C | 276 ++++++++++++++++++ 3 files changed, 280 insertions(+), 264 deletions(-) delete mode 100644 src/stats/test/TestVectorPdf_gsl.C create mode 100644 test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C diff --git a/src/stats/test/TestVectorPdf_gsl.C b/src/stats/test/TestVectorPdf_gsl.C deleted file mode 100644 index c2b491416..000000000 --- a/src/stats/test/TestVectorPdf_gsl.C +++ /dev/null @@ -1,264 +0,0 @@ -#define BOOST_TEST_MODULE -#include -#include - -#include -#include -#include - -#define PI 3.14159265358979323846 - -using namespace QUESO; - -BOOST_AUTO_TEST_CASE( test_uqGaussianVectorPdf ) -{ - // Initialize - MPI_Init(NULL, NULL); - uqFullEnvironment env; - uqVectorSpace domainSpace(env, "test_space", 2, NULL); - uqMap eMap(2, 0, env.comm()); - - uqGslVector domainMinVal(env, eMap, -1e30); - uqGslVector domainMaxVal(env, eMap, 1e30); - - uqGaussianVectorPdf* gaussianPdf; - double tolClose = 1e-13, tolSmall = 1e-16; - - //*********************************************************************** - // Tests for diagonal covariance matrix - // NOTE: distribution is not normalized - //*********************************************************************** - - // mean = [0; 0], var = [1; 1] - uqGslVector expectedVal(env, eMap, 0.0); - uqGslVector varianceVal(env, eMap, 1.0); - uqGslVector testValues(env, eMap, 0.0); - - gaussianPdf = new uqGaussianVectorPdf("test_pdf", domainSpace, domainMinVal, - domainMaxVal, expectedVal, varianceVal); - - testValues[0] = testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), 1.0, tolClose); - BOOST_REQUIRE_SMALL(gaussianPdf->minus2LnDensity(testValues), tolSmall); // can't check close b/c exact val = 0 - - testValues[0] = 1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - testValues[0] = 1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - delete gaussianPdf; - - // mean = [0; 0], var = [0.25; 0.5] - varianceVal[0] = 0.25; varianceVal[1] = 0.5; - - gaussianPdf = new uqGaussianVectorPdf("test_pdf", domainSpace, domainMinVal, - domainMaxVal, expectedVal, varianceVal); - - testValues[0] = testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), 1.0, tolClose); - BOOST_REQUIRE_SMALL(gaussianPdf->minus2LnDensity(testValues), tolSmall); // can't check close b/c exact val = 0 - - testValues[0] = 1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-3.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 6.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-3.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 6.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-2.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 4.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-3.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 6.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-3.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 6.0 , tolClose); - - testValues[0] = 1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-2.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 4.0 , tolClose); - - // mean = [1.0; -0.5], var = [0.25; 0.5] - expectedVal[0] = 1.0; expectedVal[1] = -0.5; - - gaussianPdf->updateExpectedValues(expectedVal); // just update expected value (don't reallocate everything) - - testValues[0] = 0.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-2.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 4.5 , tolClose); - - testValues[0] = 1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-2.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 4.5 , tolClose); - - testValues[0] = 0.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-4.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 8.5 , tolClose); - - testValues[0] = -1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-10.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 20.5 , tolClose); - - testValues[0] = -1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-8.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 16.5 , tolClose); - - testValues[0] = -1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-8.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 16.5 , tolClose); - - testValues[0] = 0.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-2.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 4.5 , tolClose); - - testValues[0] = 1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 0.5 , tolClose); - - testValues[0] = 1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.25), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 0.5 , tolClose); - - delete gaussianPdf; - - //*********************************************************************** - // Tests for general covariance matrix - // NOTE: distribution is not normalized - //*********************************************************************** - - // mean = [0; 0], covar = [1, 0; 0, 1], i.e. same as first case for diagonal matrices - expectedVal[0] = expectedVal[1] = 0.0; - - uqGslMatrix covMatrix(env, eMap, 1.0); // actually diagonal - - gaussianPdf = new uqGaussianVectorPdf("test_pdf", domainSpace, domainMinVal, - domainMaxVal, expectedVal, covMatrix); - - testValues[0] = testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), 1.0, tolClose); - BOOST_REQUIRE_SMALL(gaussianPdf->minus2LnDensity(testValues), tolSmall); // can't check close b/c exact val = 0 - - testValues[0] = 1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - testValues[0] = 1.0; testValues[1] = -1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - testValues[0] = 1.0; testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.5), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.0 , tolClose); - - //delete gaussianPdf; - - // mean = [0, 0], covar = [2, 1; 1, 2]; - covMatrix(0,0) = 2.0; covMatrix(0,1) = 1.0; - covMatrix(1,0) = 1.0; covMatrix(1,1) = 2.0; - -// gaussianPdf = new uqGaussianVectorPdf("test_pdf", domainSpace, domainMinVal, -// domainMaxVal, expectedVal, covMatrix); - - gaussianPdf->updateCovMatrix(covMatrix); - - testValues[0] = testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), 1.0, tolClose); - BOOST_REQUIRE_SMALL(gaussianPdf->minus2LnDensity(testValues), tolSmall); // can't check close b/c exact val = 0 - - testValues[0] = 1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0/3.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0/3.0 , tolClose); - - testValues[0] = 0.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0/3.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0/3.0 , tolClose); - - testValues[0] = -1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.0), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 2.0 , tolClose); - - // mean = [1.0, -0.5], covar = [2, 1; 1, 2]; - expectedVal[0] = 1.0; expectedVal[1] = -0.5; - - gaussianPdf->updateExpectedValues(expectedVal); // just update expected value (don't reallocate everything) - - testValues[0] = testValues[1] = 0.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-5.833333333333333e-01), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.166666666666667e+00 , tolClose); - - testValues[0] = 1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-0.75), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 1.5 , tolClose); - - testValues[0] = 0.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-1.583333333333333e+00), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 3.166666666666667e+00 , tolClose); - - testValues[0] = -1.0; testValues[1] = 1.0; - BOOST_REQUIRE_CLOSE(gaussianPdf->actualDensity(testValues), std::exp(-3.083333333333333e+00), tolClose); - BOOST_REQUIRE_CLOSE(gaussianPdf->minus2LnDensity(testValues), 6.166666666666666e+00 , tolClose); - - delete gaussianPdf; - - // Clean up - MPI_Finalize(); -} diff --git a/test/Makefile.am b/test/Makefile.am index af2223d37..ea91ce7b5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -12,6 +12,7 @@ check_PROGRAMS += test_uqEnvironmentOptionsPrint check_PROGRAMS += test_uqGslVectorConstructorFatal check_PROGRAMS += test_uqGslVector check_PROGRAMS += test_uqGaussianVectorRVClass +check_PROGRAMS += test_VectorPdf_gsl check_PROGRAMS += test_uqGslMatrixConstructorFatal check_PROGRAMS += test_uqGslMatrix check_PROGRAMS += test_uqTeuchosVector @@ -77,6 +78,7 @@ test_uqEnvironmentOptionsPrint_SOURCES = test_uqEnvironmentOptions/test_uqEnviro test_uqGslVectorConstructorFatal_SOURCES = test_GslVector/test_uqGslVectorConstructorFatal.C test_uqGslVector_SOURCES = test_GslVector/test_uqGslVector.C test_uqGaussianVectorRVClass_SOURCES = test_GaussianVectorRVClass/test_uqGaussianVectorRVClass.C +test_VectorPdf_gsl_SOURCES = test_GaussianVectorRVClass/test_VectorPdf_gsl.C test_uqGslMatrixConstructorFatal_SOURCES = test_GslMatrix/test_uqGslMatrixConstructorFatal.C test_uqGslMatrix_SOURCES = test_GslMatrix/test_uqGslMatrix.C test_uqTeuchosVector_SOURCES = test_TeuchosVector/test_uqTeuchosVector.C @@ -117,6 +119,7 @@ srcstamp += $(test_uqEnvironmentOptionsPrint_SOURCES) srcstamp += $(test_uqGslVectorConstructorFatal_SOURCES) srcstamp += $(test_uqGslVector_SOURCES) srcstamp += $(test_uqGaussianVectorRVClass_SOURCES) +srcstamp += $(test_VectorPdf_gsl_SOURCES) srcstamp += $(test_uqGslMatrixConstructorFatal_SOURCES) srcstamp += $(test_uqGslMatrix_SOURCES) srcstamp += $(test_uqTeuchosVector_SOURCES) @@ -154,6 +157,7 @@ TESTS += $(top_builddir)/test/test_uqEnvironmentOptionsPrint TESTS += $(top_builddir)/test/test_uqGslVectorConstructorFatal TESTS += $(top_builddir)/test/test_uqGslVector TESTS += $(top_builddir)/test/test_uqGaussianVectorRVClass +TESTS += $(top_builddir)/test/test_VectorPdf_gsl TESTS += $(top_builddir)/test/test_uqGslMatrixConstructorFatal TESTS += $(top_builddir)/test/test_uqGslMatrix TESTS += $(top_builddir)/test/test_uqTeuchosVector diff --git a/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C b/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C new file mode 100644 index 000000000..c2e285f0f --- /dev/null +++ b/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C @@ -0,0 +1,276 @@ +#include +#include +#include + +#define PI 3.14159265358979323846 + +#define QUESO_REQUIRE_CLOSE(a, b, c) do { if (!require_close(a, b, c)) { \ + std::cerr << "FAILED: " << a \ + << " and " << b \ + << " differ by " << c \ + << " in the relative " \ + << "sense." \ + << std::endl; \ + queso_error(); \ + } \ + } while (0) + +using namespace QUESO; + +int require_close(double a, double b, double tol) { + return (std::abs(a - b) / std::abs(b) > tol) ? 0 : 1; +} + +int main(int argc, char ** argv) { + // Initialize + MPI_Init(NULL, NULL); + + EnvOptionsValues envOptionsValues; + FullEnvironment env(MPI_COMM_WORLD, "", "", &envOptionsValues); + + VectorSpace domainSpace(env, "test_space", 2, NULL); + Map eMap(2, 0, env.fullComm()); + + GslVector domainMinVal(env, eMap, -1e30); + GslVector domainMaxVal(env, eMap, 1e30); + + BoxSubset domain("domain", domainSpace, domainMinVal, domainMaxVal); + + GaussianJointPdf* gaussianPdf; + double tolClose = 1e-13; + + //*********************************************************************** + // Tests for diagonal covariance matrix + //*********************************************************************** + + // mean = [0; 0], var = [1; 1] + GslVector expectedVal(env, eMap, 0.0); + GslVector varianceVal(env, eMap, 1.0); + GslVector testValues(env, eMap, 0.0); + + gaussianPdf = new GaussianJointPdf("test_pdf", domain, expectedVal, varianceVal); + double normalisingConstant = 1.0 / (2.0 * PI); + double logNormalisingConstant = std::log(normalisingConstant); + + testValues[0] = testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant, tolClose); + + testValues[0] = 1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 0.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + testValues[0] = -1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = -1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + testValues[0] = -1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 0.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + testValues[0] = 1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + delete gaussianPdf; + + // mean = [0; 0], var = [0.25; 0.5] + varianceVal[0] = 0.25; varianceVal[1] = 0.5; + + gaussianPdf = new GaussianJointPdf("test_pdf", domain, expectedVal, varianceVal); + normalisingConstant = 1.0 / (2.0 * PI * std::sqrt(0.125)); + logNormalisingConstant = std::log(normalisingConstant); + + testValues[0] = testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant, tolClose); + + testValues[0] = 1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-3.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 3.0, tolClose); + + testValues[0] = 0.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = -1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-3.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 3.0, tolClose); + + testValues[0] = -1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-2.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 2.0, tolClose); + + testValues[0] = -1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-3.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 3.0, tolClose); + + testValues[0] = 0.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-3.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 3.0, tolClose); + + testValues[0] = 1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-2.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 2.0, tolClose); + + // mean = [1.0; -0.5], var = [0.25; 0.5] + expectedVal[0] = 1.0; expectedVal[1] = -0.5; + + gaussianPdf->updateLawExpVector(expectedVal); // just update expected value (don't reallocate everything) + + testValues[0] = 0.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-2.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 2.25, tolClose); + + testValues[0] = 1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-2.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 2.25, tolClose); + + testValues[0] = 0.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-4.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 4.25, tolClose); + + testValues[0] = -1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-10.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 10.25, tolClose); + + testValues[0] = -1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-8.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 8.25, tolClose); + + testValues[0] = -1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-8.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 8.25, tolClose); + + testValues[0] = 0.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-2.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 2.25, tolClose); + + testValues[0] = 1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.25, tolClose); + + testValues[0] = 1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.25), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.25, tolClose); + + delete gaussianPdf; + + //*********************************************************************** + // Tests for general covariance matrix + //*********************************************************************** + + // mean = [0; 0], covar = [1, 0; 0, 1], i.e. same as first case for diagonal matrices + expectedVal[0] = expectedVal[1] = 0.0; + + GslMatrix covMatrix(env, eMap, 1.0); // actually diagonal + + gaussianPdf = new GaussianJointPdf("test_pdf", domain, expectedVal, covMatrix); + normalisingConstant = 1.0 / (2.0 * PI); + logNormalisingConstant = std::log(normalisingConstant); + + testValues[0] = testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant, tolClose); + + testValues[0] = 1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 0.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + testValues[0] = -1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = -1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + testValues[0] = -1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 0.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + testValues[0] = 1.0; testValues[1] = -1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + testValues[0] = 1.0; testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.5), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.5, tolClose); + + //delete gaussianPdf; + + // mean = [0, 0], covar = [2, 1; 1, 2]; + covMatrix(0,0) = 2.0; covMatrix(0,1) = 1.0; + covMatrix(1,0) = 1.0; covMatrix(1,1) = 2.0; + + gaussianPdf->updateLawCovMatrix(covMatrix); + normalisingConstant = 1.0 / (2.0 * PI * std::sqrt(3.0)); + logNormalisingConstant = std::log(normalisingConstant); + + testValues[0] = testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant, tolClose); + + testValues[0] = 1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0/3.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - (1.0/3.0), tolClose); + + testValues[0] = 0.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0/3.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - (1.0/3.0), tolClose); + + testValues[0] = -1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.0, tolClose); + + // mean = [1.0, -0.5], covar = [2, 1; 1, 2]; + expectedVal[0] = 1.0; expectedVal[1] = -0.5; + + gaussianPdf->updateLawExpVector(expectedVal); // just update expected value (don't reallocate everything) + + testValues[0] = testValues[1] = 0.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-5.833333333333333e-01), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 5.833333333333333e-01, tolClose); + + testValues[0] = 1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-0.75), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 0.75, tolClose); + + testValues[0] = 0.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.583333333333333e+00), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 1.583333333333333e+00, tolClose); + + testValues[0] = -1.0; testValues[1] = 1.0; + QUESO_REQUIRE_CLOSE(gaussianPdf->actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-3.083333333333333e+00), tolClose); + QUESO_REQUIRE_CLOSE(gaussianPdf->lnValue(testValues, NULL, NULL, NULL, NULL), logNormalisingConstant - 3.083333333333333e+00, tolClose); + + delete gaussianPdf; + + MPI_Finalize(); + + return 0; +} From d0666a22ab116ab38a24ba023ffbd4c039de52d9 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 11 Dec 2014 16:55:56 -0600 Subject: [PATCH 71/99] Repurpose old RV test --- src/stats/test/TestVectorRV_gsl.C | 57 -------------- test/Makefile.am | 4 + .../test_VectorPdf_gsl.C | 2 +- .../test_VectorRV_gsl.C | 75 +++++++++++++++++++ 4 files changed, 80 insertions(+), 58 deletions(-) delete mode 100644 src/stats/test/TestVectorRV_gsl.C create mode 100644 test/test_GaussianVectorRVClass/test_VectorRV_gsl.C diff --git a/src/stats/test/TestVectorRV_gsl.C b/src/stats/test/TestVectorRV_gsl.C deleted file mode 100644 index cfeeb8ee0..000000000 --- a/src/stats/test/TestVectorRV_gsl.C +++ /dev/null @@ -1,57 +0,0 @@ -#define BOOST_TEST_MODULE -#include -#include - -#include -#include -#include - -using namespace QUESO; - -BOOST_AUTO_TEST_CASE( test_uqGaussianVectorRV ) -{ - // Initialize - MPI_Init(NULL, NULL); - uqFullEnvironment env; - uqVectorSpace imageSpace(env, "test_space", 2, NULL); - uqMap eMap(2, 0, env.comm()); - - uqGslVector imageMinVal(env, eMap, -INFINITY); - uqGslVector imageMaxVal(env, eMap, INFINITY); - - uqGslVector initExpectedValues(env, eMap, 0.0); - uqGslMatrix initCovMatrix(env, eMap, 1.0); - - uqGslVector finalExpectedValues(env, eMap, 1.0); - uqGslMatrix finalCovMatrix(env, eMap, 3.0); - - uqGslVector testValues(env, eMap, 0.0); - - uqGaussianVectorRV gaussianRV("test_rv", imageSpace, imageMinVal, imageMaxVal, - initExpectedValues, initCovMatrix); - double tolClose = 1e-13, tolSmall = 1e-16; - - //*********************************************************************** - // Test pdf - // NOTE: pdf is not normalized - //*********************************************************************** - - // mean = [0; 0], var = [1; 1], testValues = [0; 0] - BOOST_REQUIRE_CLOSE(gaussianRV.pdf().actualDensity(testValues), 1.0, tolClose); - - // change mean and check that new pdf is correct - gaussianRV.updateExpectedValues(finalExpectedValues); - BOOST_REQUIRE_CLOSE(gaussianRV.pdf().actualDensity(testValues), std::exp(-1.0), tolClose); - - //*********************************************************************** - // Test realizer - // NOTE: just calls it... doesn't check values - //*********************************************************************** - uqGslVector myRealization(testValues); - gaussianRV.realizer().realization(myRealization); - - std::cout << myRealization; - - // finalize - MPI_Finalize(); -} diff --git a/test/Makefile.am b/test/Makefile.am index ea91ce7b5..ab2f2078f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -13,6 +13,7 @@ check_PROGRAMS += test_uqGslVectorConstructorFatal check_PROGRAMS += test_uqGslVector check_PROGRAMS += test_uqGaussianVectorRVClass check_PROGRAMS += test_VectorPdf_gsl +check_PROGRAMS += test_VectorRV_gsl check_PROGRAMS += test_uqGslMatrixConstructorFatal check_PROGRAMS += test_uqGslMatrix check_PROGRAMS += test_uqTeuchosVector @@ -79,6 +80,7 @@ test_uqGslVectorConstructorFatal_SOURCES = test_GslVector/test_uqGslVectorConstr test_uqGslVector_SOURCES = test_GslVector/test_uqGslVector.C test_uqGaussianVectorRVClass_SOURCES = test_GaussianVectorRVClass/test_uqGaussianVectorRVClass.C test_VectorPdf_gsl_SOURCES = test_GaussianVectorRVClass/test_VectorPdf_gsl.C +test_VectorRV_gsl_SOURCES = test_GaussianVectorRVClass/test_VectorRV_gsl.C test_uqGslMatrixConstructorFatal_SOURCES = test_GslMatrix/test_uqGslMatrixConstructorFatal.C test_uqGslMatrix_SOURCES = test_GslMatrix/test_uqGslMatrix.C test_uqTeuchosVector_SOURCES = test_TeuchosVector/test_uqTeuchosVector.C @@ -120,6 +122,7 @@ srcstamp += $(test_uqGslVectorConstructorFatal_SOURCES) srcstamp += $(test_uqGslVector_SOURCES) srcstamp += $(test_uqGaussianVectorRVClass_SOURCES) srcstamp += $(test_VectorPdf_gsl_SOURCES) +srcstamp += $(test_VectorRV_gsl_SOURCES) srcstamp += $(test_uqGslMatrixConstructorFatal_SOURCES) srcstamp += $(test_uqGslMatrix_SOURCES) srcstamp += $(test_uqTeuchosVector_SOURCES) @@ -158,6 +161,7 @@ TESTS += $(top_builddir)/test/test_uqGslVectorConstructorFatal TESTS += $(top_builddir)/test/test_uqGslVector TESTS += $(top_builddir)/test/test_uqGaussianVectorRVClass TESTS += $(top_builddir)/test/test_VectorPdf_gsl +TESTS += $(top_builddir)/test/test_VectorRV_gsl TESTS += $(top_builddir)/test/test_uqGslMatrixConstructorFatal TESTS += $(top_builddir)/test/test_uqGslMatrix TESTS += $(top_builddir)/test/test_uqTeuchosVector diff --git a/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C b/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C index c2e285f0f..a5fc3404a 100644 --- a/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C +++ b/test/test_GaussianVectorRVClass/test_VectorPdf_gsl.C @@ -23,7 +23,7 @@ int require_close(double a, double b, double tol) { int main(int argc, char ** argv) { // Initialize - MPI_Init(NULL, NULL); + MPI_Init(&argc, &argv); EnvOptionsValues envOptionsValues; FullEnvironment env(MPI_COMM_WORLD, "", "", &envOptionsValues); diff --git a/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C b/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C new file mode 100644 index 000000000..59c1f9c26 --- /dev/null +++ b/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C @@ -0,0 +1,75 @@ +#include +#include +#include + +#define PI 3.14159265358979323846 + +#define QUESO_REQUIRE_CLOSE(a, b, c) do { if (!require_close(a, b, c)) { \ + std::cerr << "FAILED: " << a \ + << " and " << b \ + << " differ by " << c \ + << " in the relative " \ + << "sense." \ + << std::endl; \ + queso_error(); \ + } \ + } while (0) + +using namespace QUESO; + +int require_close(double a, double b, double tol) { + return (std::abs(a - b) / std::abs(b) > tol) ? 0 : 1; +} + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + EnvOptionsValues envOptionsValues; + FullEnvironment env(MPI_COMM_WORLD, "", "", &envOptionsValues); + + VectorSpace imageSpace(env, "test_space", 2, NULL); + Map eMap(2, 0, env.fullComm()); + + GslVector imageMinVal(env, eMap, -INFINITY); + GslVector imageMaxVal(env, eMap, INFINITY); + + BoxSubset domain("domain", imageSpace, imageMinVal, + imageMaxVal); + + GslVector initExpectedValues(env, eMap, 0.0); + GslMatrix initCovMatrix(env, eMap, 1.0); + + GslVector finalExpectedValues(env, eMap, 1.0); + GslMatrix finalCovMatrix(env, eMap, 3.0); + + GslVector testValues(env, eMap, 0.0); + + GaussianVectorRV gaussianRV("test_rv", domain, + initExpectedValues, initCovMatrix); + double normalisingConstant = 1.0 / (2.0 * PI); + + double tolClose = 1e-13; + + //*********************************************************************** + // Test pdf + //*********************************************************************** + + // mean = [0; 0], var = [1; 1], testValues = [0; 0] + QUESO_REQUIRE_CLOSE(gaussianRV.pdf().actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant, tolClose); + + // change mean and check that new pdf is correct + gaussianRV.updateLawExpVector(finalExpectedValues); + QUESO_REQUIRE_CLOSE(gaussianRV.pdf().actualValue(testValues, NULL, NULL, NULL, NULL), normalisingConstant * std::exp(-1.0), tolClose); + + //*********************************************************************** + // Test realizer + // NOTE: just calls it... doesn't check values + //*********************************************************************** + GslVector myRealization(testValues); + gaussianRV.realizer().realization(myRealization); + + std::cout << myRealization; + + // finalize + MPI_Finalize(); +} From 455c4eab983277d45991401ddcfbb4858e84c137 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 11 Dec 2014 17:19:33 -0600 Subject: [PATCH 72/99] Repurpose Gaussian realizer test --- src/stats/test/TestVectorRealizer_gsl.C | 80 --------------- test/Makefile.am | 4 + .../test_VectorRV_gsl.C | 2 + .../test_VectorRealizer_gsl.C | 98 +++++++++++++++++++ 4 files changed, 104 insertions(+), 80 deletions(-) delete mode 100644 src/stats/test/TestVectorRealizer_gsl.C create mode 100644 test/test_GaussianVectorRVClass/test_VectorRealizer_gsl.C diff --git a/src/stats/test/TestVectorRealizer_gsl.C b/src/stats/test/TestVectorRealizer_gsl.C deleted file mode 100644 index 3eeb15293..000000000 --- a/src/stats/test/TestVectorRealizer_gsl.C +++ /dev/null @@ -1,80 +0,0 @@ -#define BOOST_TEST_MODULE -#include -#include - -#include -#include -#include - -using namespace QUESO; - -BOOST_AUTO_TEST_CASE( test_uqGaussianVectorRealizer ) -{ - // Initialize - MPI_Init(NULL, NULL); - uqFullEnvironment env; // Puts random number generator in known state... will generate same sequence each run - uqVectorSpace imageSpace(env, "test_space", 2, NULL); - uqMap eMap(2, 0, env.comm()); - - double tol = 1e-16; - - - // Tests - - // Test 1: mean = 0, covMatrix = identity - uqGslVector expectedValues(env, eMap, 0.0); - uqGslMatrix lowerCholCovMatrix(env, eMap, 1.0); // identity - - int ierr = lowerCholCovMatrix.chol(); - BOOST_REQUIRE( ierr==0 ); // make sure cholesky succeeded - - lowerCholCovMatrix.zeroUpper(false); // zero upper triangular - - uqGaussianVectorRealizer* gaussianRealizer = - new uqGaussianVectorRealizer("test_realizer", - imageSpace, - expectedValues, - lowerCholCovMatrix); - - uqGslVector myRealization(expectedValues); - - gaussianRealizer->realization(myRealization); - //std::cout << "myRealization = " << std::setprecision(16) << std::scientific << myRealization << "\n"; - - // NOTE: Data generated by running rng (i.e. this is a regression test). - // If default seed value or rng algorithm are changed, these asserts will fail. - BOOST_REQUIRE_CLOSE(myRealization[0], 2.2285703126720258e-01, tol); - BOOST_REQUIRE_CLOSE(myRealization[1], -8.5156524864967331e-01, tol); - - delete gaussianRealizer; - - // Test 2: mean = [-2; 1], covMatrix = [2, 1; 1, 2] - expectedValues[0] = -2.0; expectedValues[1] = 1.0; - - lowerCholCovMatrix(0,0) = 2.0; lowerCholCovMatrix(0,1) = 1.0; - lowerCholCovMatrix(1,0) = 1.0; lowerCholCovMatrix(1,1) = 2.0; - - ierr = lowerCholCovMatrix.chol(); - BOOST_REQUIRE( ierr==0 ); // make sure cholesky succeeded - - lowerCholCovMatrix.zeroUpper(false); // zero upper triangular - - gaussianRealizer = new uqGaussianVectorRealizer("test_realizer", - imageSpace, - expectedValues, - lowerCholCovMatrix); - - // Generate realization - gaussianRealizer->realization(myRealization); - //std::cout << "myRealization = " << std::setprecision(16) << std::scientific << myRealization << "\n"; - - BOOST_REQUIRE_CLOSE(myRealization[0], -1.315078621127142e+00, tol); - BOOST_REQUIRE_CLOSE(myRealization[1], 9.780380444774379e-01, tol); - - delete gaussianRealizer; - - - // Clean up - MPI_Finalize(); - -} diff --git a/test/Makefile.am b/test/Makefile.am index ab2f2078f..ed488f1e6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -14,6 +14,7 @@ check_PROGRAMS += test_uqGslVector check_PROGRAMS += test_uqGaussianVectorRVClass check_PROGRAMS += test_VectorPdf_gsl check_PROGRAMS += test_VectorRV_gsl +check_PROGRAMS += test_VectorRealizer_gsl check_PROGRAMS += test_uqGslMatrixConstructorFatal check_PROGRAMS += test_uqGslMatrix check_PROGRAMS += test_uqTeuchosVector @@ -81,6 +82,7 @@ test_uqGslVector_SOURCES = test_GslVector/test_uqGslVector.C test_uqGaussianVectorRVClass_SOURCES = test_GaussianVectorRVClass/test_uqGaussianVectorRVClass.C test_VectorPdf_gsl_SOURCES = test_GaussianVectorRVClass/test_VectorPdf_gsl.C test_VectorRV_gsl_SOURCES = test_GaussianVectorRVClass/test_VectorRV_gsl.C +test_VectorRealizer_gsl_SOURCES = test_GaussianVectorRVClass/test_VectorRealizer_gsl.C test_uqGslMatrixConstructorFatal_SOURCES = test_GslMatrix/test_uqGslMatrixConstructorFatal.C test_uqGslMatrix_SOURCES = test_GslMatrix/test_uqGslMatrix.C test_uqTeuchosVector_SOURCES = test_TeuchosVector/test_uqTeuchosVector.C @@ -123,6 +125,7 @@ srcstamp += $(test_uqGslVector_SOURCES) srcstamp += $(test_uqGaussianVectorRVClass_SOURCES) srcstamp += $(test_VectorPdf_gsl_SOURCES) srcstamp += $(test_VectorRV_gsl_SOURCES) +srcstamp += $(test_VectorRealizer_gsl_SOURCES) srcstamp += $(test_uqGslMatrixConstructorFatal_SOURCES) srcstamp += $(test_uqGslMatrix_SOURCES) srcstamp += $(test_uqTeuchosVector_SOURCES) @@ -162,6 +165,7 @@ TESTS += $(top_builddir)/test/test_uqGslVector TESTS += $(top_builddir)/test/test_uqGaussianVectorRVClass TESTS += $(top_builddir)/test/test_VectorPdf_gsl TESTS += $(top_builddir)/test/test_VectorRV_gsl +TESTS += $(top_builddir)/test/test_VectorRealizer_gsl TESTS += $(top_builddir)/test/test_uqGslMatrixConstructorFatal TESTS += $(top_builddir)/test/test_uqGslMatrix TESTS += $(top_builddir)/test/test_uqTeuchosVector diff --git a/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C b/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C index 59c1f9c26..98fe51c0a 100644 --- a/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C +++ b/test/test_GaussianVectorRVClass/test_VectorRV_gsl.C @@ -72,4 +72,6 @@ int main(int argc, char ** argv) { // finalize MPI_Finalize(); + + return 0; } diff --git a/test/test_GaussianVectorRVClass/test_VectorRealizer_gsl.C b/test/test_GaussianVectorRVClass/test_VectorRealizer_gsl.C new file mode 100644 index 000000000..c24a7359f --- /dev/null +++ b/test/test_GaussianVectorRVClass/test_VectorRealizer_gsl.C @@ -0,0 +1,98 @@ +#include +#include +#include + +#define QUESO_REQUIRE_CLOSE(a, b, c) do { if (!require_close(a, b, c)) { \ + std::cerr << "FAILED: " << a \ + << " and " << b \ + << " differ by " << c \ + << " in the relative " \ + << "sense." \ + << std::endl; \ + queso_error(); \ + } \ + } while (0) + +#define QUESO_REQUIRE(a) do { if (!(a)) { \ + std::cerr << "FAILED: " << (a) \ + << " is false." \ + << std::endl; \ + queso_error(); \ + } \ + } while (0) + +using namespace QUESO; + +int require_close(double a, double b, double tol) { + return (std::abs(a - b) / std::abs(b) > tol) ? 0 : 1; +} + +int main(int argc, char ** argv) { + MPI_Init(&argc, &argv); + + EnvOptionsValues envOptionsValues; + FullEnvironment env(MPI_COMM_WORLD, "", "", &envOptionsValues); + + VectorSpace imageSpace(env, "test_space", 2, NULL); + Map eMap(2, 0, env.fullComm()); + + GslVector imageMinVal(env, eMap, -INFINITY); + GslVector imageMaxVal(env, eMap, INFINITY); + + BoxSubset domain("domain", imageSpace, imageMinVal, + imageMaxVal); + + double tol = 1e-16; + + // Tests + // Test 1: mean = 0, covMatrix = identity + GslVector expectedValues(env, eMap, 0.0); + GslMatrix lowerCholCovMatrix(env, eMap, 1.0); // identity + + int ierr = lowerCholCovMatrix.chol(); + QUESO_REQUIRE( ierr==0 ); // make sure cholesky succeeded + + lowerCholCovMatrix.zeroUpper(false); // zero upper triangular + + GaussianVectorRealizer* gaussianRealizer = + new GaussianVectorRealizer("test_realizer", + domain, expectedValues, lowerCholCovMatrix); + + GslVector myRealization(expectedValues); + + gaussianRealizer->realization(myRealization); + + // NOTE: Data generated by running rng (i.e. this is a regression test). + // If default seed value or rng algorithm are changed, these asserts will fail. + QUESO_REQUIRE_CLOSE(myRealization[0], 2.2285703126720258e-01, tol); + QUESO_REQUIRE_CLOSE(myRealization[1], -8.5156524864967331e-01, tol); + + delete gaussianRealizer; + + // Test 2: mean = [-2; 1], covMatrix = [2, 1; 1, 2] + expectedValues[0] = -2.0; expectedValues[1] = 1.0; + + lowerCholCovMatrix(0,0) = 2.0; lowerCholCovMatrix(0,1) = 1.0; + lowerCholCovMatrix(1,0) = 1.0; lowerCholCovMatrix(1,1) = 2.0; + + ierr = lowerCholCovMatrix.chol(); + QUESO_REQUIRE( ierr==0 ); // make sure cholesky succeeded + + lowerCholCovMatrix.zeroUpper(false); // zero upper triangular + + gaussianRealizer = new GaussianVectorRealizer( + "test_realizer", domain, expectedValues, lowerCholCovMatrix); + + // Generate realization + gaussianRealizer->realization(myRealization); + + QUESO_REQUIRE_CLOSE(myRealization[0], -1.315078621127142e+00, tol); + QUESO_REQUIRE_CLOSE(myRealization[1], 9.780380444774379e-01, tol); + + delete gaussianRealizer; + + // Clean up + MPI_Finalize(); + + return 0; +} From b69a544abc3f22789a5a65d5ce6eb83611756928 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Thu, 11 Dec 2014 17:38:44 -0600 Subject: [PATCH 73/99] Update ignores --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 4844c62bc..332e8e8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -176,3 +176,6 @@ test/test_gaussian_likelihoods/queso_input.txt test/test_GslBlockMatrixInvertMultiply test/test_SequenceOfVectors/test_unifiedPositionsOfMaximum.sh test/test_unifiedPositionsOfMaximum +test/test_VectorPdf_gsl +test/test_VectorRV_gsl +test/test_VectorRealizer_gsl From ff919f5352354b825e691e12337bcfd9fbf12ec6 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 17 Mar 2015 09:54:39 -0600 Subject: [PATCH 74/99] Fix language statistics for github --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..78ed7f299 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +*.m linguist-vendored +*.dat linguist-vendored +*.tab linguist-vendored +*.txt linguist-vendored +*.C linguist-language=C++ +*.h linguist-language=C++ +*.cpp linguist-language=C++ From cf5873218ca34bb5c9602d1846a65c5250d6d78e Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 17 Mar 2015 11:26:58 -0600 Subject: [PATCH 75/99] Use CLEANFILES for test output --- test/Makefile.am | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index ed488f1e6..6b7db734d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -222,24 +222,15 @@ EXTRA_DIST += test_Regression/adaptedcov_input.txt.in EXTRA_DIST += test_gaussian_likelihoods/queso_input.txt.in EXTRA_DIST += test_SequenceOfVectors/test_unifiedPositionsOfMaximum.sh.in -DISTCLEANFILES = -DISTCLEANFILES += test_gpmsa_cobra_output/display_sub0.txt -DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain.m -DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_loglikelihood.m -DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_loglikelihood_sub0.m -DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_logtarget.m -DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_logtarget_sub0.m -DISTCLEANFILES += test_gpmsa_cobra_output/ip_raw_chain_sub0.m -DISTCLEANFILES += test_gpmsa_cobra_output/sipOutput_sub0.m -DISTCLEANFILES += test_output_gaussian_likelihoods/display_sub0.txt - CLEANFILES = -CLEANFILES += $(top_srcdir)/test/test_Environment/debug_output_sub0.txt -CLEANFILES += $(top_srcdir)/test/gslvector_out_sub0.m +CLEANFILES += test_Environment/debug_output_sub0.txt +CLEANFILES += gslvector_out_sub0.m clean-local: rm -rf $(top_builddir)/test/chain0 rm -rf $(top_builddir)/test/outputData + rm -rf $(top_builddir)/test/test_output_gaussian_likelihoods + rm -rf $(top_builddir)/test/test_gpmsa_cobra_output if CODE_COVERAGE_ENABLED CLEANFILES += *.gcda *.gcno From c9b78819188a267008a07aa851014c06a2f6a5f8 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 17 Mar 2015 14:07:18 -0600 Subject: [PATCH 76/99] Remove control characters --- COPYING | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/COPYING b/COPYING index 7e6dbc15b..ca4f73b7b 100644 --- a/COPYING +++ b/COPYING @@ -158,7 +158,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -267,7 +267,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -422,7 +422,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -454,4 +454,3 @@ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - From 46e734e30138424bf08bf727652fbb45f2bfc668 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 17 Mar 2015 14:09:58 -0600 Subject: [PATCH 77/99] Fix licence (LGPL instead of GPL) --- manual/users/gpl.tex | 725 -------------------------------- manual/users/users.tex | 2 +- manual/users/users_0_cover.tex | 7 +- manual/users/users_7_gpl.tex | 739 --------------------------------- manual/users/users_7_lgpl.tex | 490 ++++++++++++++++++++++ 5 files changed, 495 insertions(+), 1468 deletions(-) delete mode 100644 manual/users/gpl.tex delete mode 100644 manual/users/users_7_gpl.tex create mode 100644 manual/users/users_7_lgpl.tex diff --git a/manual/users/gpl.tex b/manual/users/gpl.tex deleted file mode 100644 index 16845bae8..000000000 --- a/manual/users/gpl.tex +++ /dev/null @@ -1,725 +0,0 @@ -\documentclass[11pt]{article} - -\title{GNU GENERAL PUBLIC LICENSE} -\date{Version 3, 29 June 2007} - -\begin{document} -\maketitle - -\begin{center} -{\parindent 0in - -Copyright \copyright\ 2007 Free Software Foundation, Inc. \texttt{http://fsf.org/} - -\bigskip -Everyone is permitted to copy and distribute verbatim copies of this - -license document, but changing it is not allowed.} - -\end{center} - -\renewcommand{\abstractname}{Preamble} -\begin{abstract} -The GNU General Public License is a free, copyleft license for -software and other kinds of works. - -The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - -For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - -Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - -Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and -modification follow. -\end{abstract} - -\begin{center} -{\Large \sc Terms and Conditions} -\end{center} - - -\begin{enumerate} - -\addtocounter{enumi}{-1} - -\item Definitions. - -``This License'' refers to version 3 of the GNU General Public License. - -``Copyright'' also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - -``The Program'' refers to any copyrightable work licensed under this -License. Each licensee is addressed as ``you''. ``Licensees'' and -``recipients'' may be individuals or organizations. - -To ``modify'' a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a ``modified version'' of the -earlier work or a work ``based on'' the earlier work. - -A ``covered work'' means either the unmodified Program or a work based -on the Program. - -To ``propagate'' a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - -To ``convey'' a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays ``Appropriate Legal Notices'' -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -\item Source Code. - -The ``source code'' for a work means the preferred form of the work -for making modifications to it. ``Object code'' means any non-source -form of a work. - -A ``Standard Interface'' means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - -The ``System Libraries'' of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -``Major Component'', in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - -The ``Corresponding Source'' for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - -The Corresponding Source for a work in source code form is that -same work. - -\item Basic Permissions. - -All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - -\item Protecting Users' Legal Rights From Anti-Circumvention Law. - -No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - -When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - -\item Conveying Verbatim Copies. - -You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - -\item Conveying Modified Source Versions. - -You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - \begin{enumerate} - \item The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - \item The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - ``keep intact all notices''. - - \item You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - \item If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. -\end{enumerate} -A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -``aggregate'' if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - -\item Conveying Non-Source Forms. - -You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - \begin{enumerate} - \item Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - \item Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - \item Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - \item Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - \item Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - \end{enumerate} - -A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - -A ``User Product'' is either (1) a ``consumer product'', which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, ``normally used'' refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - -``Installation Information'' for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - -If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - -The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - -\item Additional Terms. - -``Additional permissions'' are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - \begin{enumerate} - \item Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - \item Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - \item Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - \item Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - \item Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - \item Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - \end{enumerate} - -All other non-permissive additional terms are considered ``further -restrictions'' within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - -\item Termination. - -You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - -However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - -\item Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - -\item Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - -An ``entity transaction'' is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - -\item Patents. - -A ``contributor'' is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's ``contributor version''. - -A contributor's ``essential patent claims'' are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, ``control'' includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - -In the following three paragraphs, a ``patent license'' is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To ``grant'' such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - -If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. ``Knowingly relying'' means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - -A patent license is ``discriminatory'' if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - -\item No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - -\item Use with the GNU Affero General Public License. - -Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - -\item Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License ``or any later version'' applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - -Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - -\item Disclaimer of Warranty. - -\begin{sloppypar} - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY - APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE - COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE - RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. - SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL - NECESSARY SERVICING, REPAIR OR CORRECTION. -\end{sloppypar} - -\item Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN - WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES - AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR - DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL - DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM - (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED - INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE - OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH - HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - -\item Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - -\begin{center} -{\Large\sc End of Terms and Conditions} - -\bigskip -How to Apply These Terms to Your New Programs -\end{center} - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the ``copyright'' line and a pointer to where the full notice is found. - -{\footnotesize -\begin{verbatim} - - -Copyright (C) - -This program is free software: you can redistribute it and/or modify -it 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. - -This program 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. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -\end{verbatim} -} - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - -{\footnotesize -\begin{verbatim} - Copyright (C) - -This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -This is free software, and you are welcome to redistribute it -under certain conditions; type `show c' for details. -\end{verbatim} -} - -The hypothetical commands {\tt show w} and {\tt show c} should show -the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an ``about box''. - -You should also get your employer (if you work as a programmer) or -school, if any, to sign a ``copyright disclaimer'' for the program, if -necessary. For more information on this, and how to apply and follow -the GNU GPL, see \texttt{http://www.gnu.org/licenses/}. - -The GNU General Public License does not permit incorporating your -program into proprietary programs. If your program is a subroutine -library, you may consider it more useful to permit linking proprietary -applications with the library. If this is what you want to do, use -the GNU Lesser General Public License instead of this License. But -first, please read \texttt{http://www.gnu.org/philosophy/why-not-lgpl.html}. - -\end{enumerate} - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: - diff --git a/manual/users/users.tex b/manual/users/users.tex index 0e0aee367..56bd8dc6f 100644 --- a/manual/users/users.tex +++ b/manual/users/users.tex @@ -167,7 +167,7 @@ \include{users_6_fsnfd} -\include{users_7_gpl} +\include{users_7_lgpl} \include{users_8_fdl} diff --git a/manual/users/users_0_cover.tex b/manual/users/users_0_cover.tex index 2ce7d86c2..303453881 100644 --- a/manual/users/users_0_cover.tex +++ b/manual/users/users_0_cover.tex @@ -170,9 +170,10 @@ \chapter*{Preface} as well as the quantification of the uncertainties inherent in such models. The advancement of predictive science is essential for the application of Computational Science to the solution of realistic problems of national interest. -The QUESO library, since its first version, has been publicly released as open source -under the GNU General Public License and is available for free download world-wide. -See http://www.gnu.org/licenses/gpl.html for more information on the GPL software use agreement.\\ +The QUESO library is released as open source under Version 2.1 of the GNU +Lesser General Public License and is available for free download world-wide. +See https://www.gnu.org/licenses/lgpl-2.1.html for more information on the +LGPLv2.1 software use agreement.\\ % The QUESO development team currently consists of % Paul T. Bauman, diff --git a/manual/users/users_7_gpl.tex b/manual/users/users_7_gpl.tex deleted file mode 100644 index 4edb231d1..000000000 --- a/manual/users/users_7_gpl.tex +++ /dev/null @@ -1,739 +0,0 @@ -\chapter{GNU General Public License}\label{ch-gpl} - -% Taken from http://www.gnu.org/licenses/licenses.html#GPL, file gpl.tex -%--------------------------------------------------------------------- - -\date{Version 3, 29 June 2007} - - \begin{center} -% {\parindent 0in - -Copyright \copyright\ 2007 Free Software Foundation, Inc. \url{http://fsf.org/}\\ - -% \bigskip -% } - \end{center} - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - - - -\section*{Preamble} -The GNU General Public License is a free, copyleft license for -software and other kinds of works. - -The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - -For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - -Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - -Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and -modification follow. - -% \section*{\Large{Terms and Conditions}} - -\section*{Terms and Conditions} -% -% \begin{enumerate} -% -% \addtocounter{enumi}{-1} -% -% \item Definitions. - -\subsection*{0. Definitions} -``This License'' refers to version 3 of the GNU General Public License. - -``Copyright'' also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - -``The Program'' refers to any copyrightable work licensed under this -License. Each licensee is addressed as ``you''. ``Licensees'' and -``recipients'' may be individuals or organizations. - -To ``modify'' a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a ``modified version'' of the -earlier work or a work ``based on'' the earlier work. - -A ``covered work'' means either the unmodified Program or a work based -on the Program. - -To ``propagate'' a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - -To ``convey'' a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays ``Appropriate Legal Notices'' -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -% \item Source Code. -\subsection*{1. Source Code} - -The ``source code'' for a work means the preferred form of the work -for making modifications to it. ``Object code'' means any non-source -form of a work. - -A ``Standard Interface'' means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - -The ``System Libraries'' of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -``Major Component'', in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - -The ``Corresponding Source'' for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - -The Corresponding Source for a work in source code form is that -same work. - -%\item -\subsection*{2. Basic Permissions} - -All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - -% \item -\subsection*{3. Protecting Users' Legal Rights From Anti-Circumvention Law} - -No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - -When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - -% \item -\subsection*{4. Conveying Verbatim Copies} - -You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - -% \item -\subsection*{5. Conveying Modified Source Versions} - -You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - \begin{enumerate}[(a)] - \item The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - \item The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - ``keep intact all notices''. - - \item You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - \item If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. -\end{enumerate} -A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -``aggregate'' if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - -% \item -\subsection*{6. Conveying Non-Source Forms} - -You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - \begin{enumerate}[(a)] - \item Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - \item Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - \item Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - \item Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - \item Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - \end{enumerate} - -A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - -A ``User Product'' is either (1) a ``consumer product'', which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, ``normally used'' refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - -``Installation Information'' for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - -If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - -The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - -% \item -\subsection*{7. Additional Terms} - -``Additional permissions'' are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - \begin{enumerate}[(a)] - \item Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - \item Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - \item Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - \item Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - \item Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - \item Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - \end{enumerate} - -All other non-permissive additional terms are considered ``further -restrictions'' within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - -% \item -\subsection*{8. Termination} - -You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - -However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - -% \item -\subsection*{9. Acceptance Not Required for Having Copies} - -You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - -% \item -\subsection*{10. Automatic Licensing of Downstream Recipients} - -Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - -An ``entity transaction'' is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - -% \item -\subsection*{11. Patents} - -A ``contributor'' is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's ``contributor version''. - -A contributor's ``essential patent claims'' are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, ``control'' includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - -In the following three paragraphs, a ``patent license'' is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To ``grant'' such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - -If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. ``Knowingly relying'' means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - -A patent license is ``discriminatory'' if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - -% \item -\subsection*{12. No Surrender of Others' Freedom} - -If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - -% \item -\subsection*{13. Use with the GNU Affero General Public License} - -Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - -% \item -\subsection*{14. Revised Versions of this License} - -The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License ``or any later version'' applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - -Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - -% \item -\subsection*{15. Disclaimer of Warranty} - -\begin{sloppypar} - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY - APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE - COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE - RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. - SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL - NECESSARY SERVICING, REPAIR OR CORRECTION. -\end{sloppypar} - -% \item -\subsection*{16. Limitation of Liability} - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN - WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES - AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR - DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL - DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM - (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED - INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE - OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH - HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - -% \item -\subsection*{17. Interpretation of Sections 15 and 16} - -If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - -\begin{center} -{\Large\sc End of Terms and Conditions} -\end{center} - -% \bigskip -\section*{How to Apply These Terms to Your New Programs} - - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the ``copyright'' line and a pointer to where the full notice is found. -\begin{quote} -{\footnotesize -\begin{verbatim} - - -Copyright (C) - -This program is free software: you can redistribute it and/or modify -it 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. - -This program 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. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -\end{verbatim} -} -\end{quote} - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - -\begin{quote} -{\footnotesize -\begin{verbatim} - Copyright (C) - -This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -This is free software, and you are welcome to redistribute it -under certain conditions; type `show c' for details. -\end{verbatim} -} -\end{quote} - -The hypothetical commands {\tt show w} and {\tt show c} should show -the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an ``about box''. - -You should also get your employer (if you work as a programmer) or -school, if any, to sign a ``copyright disclaimer'' for the program, if -necessary. For more information on this, and how to apply and follow -the GNU GPL, see \url{http://www.gnu.org/licenses/}. - -The GNU General Public License does not permit incorporating your -program into proprietary programs. If your program is a subroutine -library, you may consider it more useful to permit linking proprietary -applications with the library. If this is what you want to do, use -the GNU Lesser General Public License instead of this License. But -first, please read \url{http://www.gnu.org/philosophy/why-not-lgpl.html}. - -% \end{enumerate} - -%--------------------------------------------------------------------- - diff --git a/manual/users/users_7_lgpl.tex b/manual/users/users_7_lgpl.tex new file mode 100644 index 000000000..ecbbd5c99 --- /dev/null +++ b/manual/users/users_7_lgpl.tex @@ -0,0 +1,490 @@ +\chapter{GNU General Public License} +\label{ch-gpl} + +% Taken from https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html +%--------------------------------------------------------------------- + +\date{Version 2.1, February 1999} + +\begin{center} +Copyright \copyright\ 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +\end{center} + +\section*{Preamble} + +The licenses for most software are designed to take away your freedom to +share and change it. By contrast, the GNU General Public Licenses are +intended to guarantee your freedom to share and change free software--to make +sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, but +we suggest you first think carefully about whether this license or the +ordinary General Public License is the better strategy to use in any +particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not +price. Our General Public Licenses are designed to make sure that you have +the freedom to distribute copies of free software (and charge for this +service if you wish); that you receive source code or can get it if you want +it; that you can change the software and use pieces of it in new free +programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors +to deny you these rights or to ask you to surrender these rights. These +restrictions translate to certain responsibilities for you if you distribute +copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a +fee, you must give the recipients all the rights that we gave you. You must +make sure that they, too, receive or can get the source code. If you link +other code with the library, you must provide complete object files to the +recipients, so that they can relink them with the library after making +changes to the library and recompiling it. And you must show them these +terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, +and (2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone +else and passed on, the recipients should know that what they have is not the +original version, so that the original author's reputation will not be +affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent +holder. Therefore, we insist that any patent license obtained for a version +of the library must be consistent with the full freedom of use specified in +this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the +ordinary General Public License. We use this license for certain libraries +in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License +therefore permits such linking only if the entire combination fits its +criteria of freedom. The Lesser General Public License permits more lax +criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less +to protect the user's freedom than the ordinary General Public License. It +also provides other free software developers Less of an advantage over +competing non-free programs. These disadvantages are the reason we use the +ordinary General Public License for many libraries. However, the Lesser +license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto +standard. To achieve this, non-free programs must be allowed to use the +library. A more frequent case is that a free library does the same job as +widely used non-free libraries. In this case, there is little to gain by +limiting the free library to free software only, so we use the Lesser General +Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables +many more people to use the whole GNU operating system, as well as its +variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a +modified version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code +derived from the library, whereas the latter must be combined with the +library in order to run. + +\section*{TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION} + +0. This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Lesser General +Public License (also called "this License"). Each licensee is addressed as +"you". + +A "library" means a collection of software functions and/or data prepared so +as to be conveniently linked with application programs (which use some of +those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means +either the Library or any derivative work under copyright law: that is to +say, a work containing the Library or a portion of it, either verbatim or +with modifications and/or translated straightforwardly into another language. +(Hereinafter, translation is included without limitation in the term +"modification".) + +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the +source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the library. + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running a program +using the Library is not restricted, and output from such a program is +covered only if its contents constitute a work based on the Library +(independent of the use of the Library in a tool for writing it). Whether +that is true depends on what the Library does and what the program that uses +the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete +source code as you receive it, in any medium, provided that you conspicuously +and appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this +License and to the absence of any warranty; and distribute a copy of this +License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may +at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you +also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. +(If a newer version than version 2 of the ordinary GNU General Public License +has appeared, then you can specify that version instead if you wish.) Do not +make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, +so the ordinary GNU General Public License applies to all subsequent copies +and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you accompany it with the complete +corresponding machine-readable source code, which must be distributed under +the terms of Sections 1 and 2 above on a medium customarily used for software +interchange. + +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code +from the same place satisfies the requirement to distribute the source code, +even though third parties are not compelled to copy the source along with the +object code. + +5. A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with it, is +called a "work that uses the Library". Such a work, in isolation, is not a +derivative work of the Library, and therefore falls outside the scope of this +License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions +of the Library), rather than a "work that uses the library". The executable +is therefore covered by this License. Section 6 states terms for +distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is +part of the Library, the object code for the work may be a derivative work of +the Library even though the source code is not. Whether this is true is +especially significant if the work can be linked without the Library, or if +the work is itself a library. The threshold for this to be true is not +precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts +and accessors, and small macros and small inline functions (ten lines or less +in length), then the use of the object file is unrestricted, regardless of +whether it is legally a derivative work. (Executables containing this object +code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the +object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are +linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a +"work that uses the Library" with the Library to produce a work containing +portions of the Library, and distribute that work under terms of your choice, +provided that the terms permit modification of the work for the customer's +own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is +used in it and that the Library and its use are covered by this License. You +must supply a copy of this License. If the work during execution displays +copyright notices, you must include the copyright notice for the Library +among them, as well as a reference directing the user to the copy of this +License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable + source code for the Library including whatever changes were used in the + work (which must be distributed under Sections 1 and 2 above); and, if the + work is an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code and/or source + code, so that the user can modify the Library and then relink to produce a + modified executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the Library + will not necessarily be able to recompile the application to use the + modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A + suitable mechanism is one that (1) uses at run time a copy of the library + already present on the user's computer system, rather than copying library + functions into the executable, and (2) will operate properly with a + modified version of the library, if the user installs one, as long as the + modified version is interface-compatible with the version that the work was + made with. + + c) Accompany the work with a written offer, valid for at least three years, + to give the same user the materials specified in Subsection 6a, above, for + a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a + designated place, offer equivalent access to copy the above specified + materials from the same place. + + e) Verify that the user has already received a copy of these materials or + that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable +from it. However, as a special exception, the materials to be distributed +need not include anything that is normally distributed (in either source or +binary form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component itself +accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating +system. Such a contradiction means you cannot use both them and the Library +together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided +that the separate distribution of the work based on the Library and of the +other library facilities is otherwise permitted, and provided that you do +these two things: + + a) Accompany the combined library with a copy of the same work based on the + Library, uncombined with any other library facilities. This must be + distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of + it is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to +copy, modify, sublicense, link with, or distribute the Library is void, and +will automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this License will +not have their licenses terminated so long as such parties remain in full +compliance. + +9. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the +Library or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or distributing the +Library (or any work based on the Library), you indicate your acceptance of +this License to do so, and all its terms and conditions for copying, +distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the original +licensor to copy, distribute, link with or modify the Library subject to +these terms and conditions. You may not impose any further restrictions on +the recipients' exercise of the rights granted herein. You are not +responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not excuse +you from the conditions of this License. If you cannot distribute so as to +satisfy simultaneously your obligations under this License and any other +pertinent obligations, then as a consequence you may not distribute the +Library at all. For example, if a patent license would not permit +royalty-free redistribution of the Library by all those who receive copies +directly or indirectly through you, then the only way you could satisfy both +it and this License would be to refrain entirely from distribution of the +Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Library under this License may add an +explicit geographical distribution limitation excluding those countries, so +that distribution is permitted only in or among countries not thus excluded. +In such case, this License incorporates the limitation as if written in the +body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and "any later +version", you have the option of following the terms and conditions either of +that version or of any later version published by the Free Software Foundation. +If the Library does not specify a license version number, you may choose any +version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the +author to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and of +promoting the sharing and reuse of software generally. + +\begin{center} +{\sc NO WARRANTY} +\end{center} + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR +IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO +THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY +PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO +LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR +THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER +SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +\begin{center} +{\Large\sc END OF TERMS AND CONDITIONS} +\end{center} + +\section*{How to Apply These Terms to Your New Programs} + +If you develop a new library, and you want it to be of the greatest possible +use to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under these +terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey the +exclusion of warranty; and each file should have at least the ``copyright'' +line and a pointer to where the full notice is found. + +\begin{verbatim} +one line to give the library's name and an idea of what it does. +Copyright (C) year name of author + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library 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 +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +\end{verbatim} + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a ``copyright disclaimer'' for the library, if necessary. Here +is a sample; alter the names: + +\begin{verbatim} +Yoyodyne, Inc., hereby disclaims all copyright interest in +the library `Frob' (a library for tweaking knobs) written +by James Random Hacker. + +signature of Ty Coon, 1 April 1990 +Ty Coon, President of Vice +\end{verbatim} + +That's all there is to it! From 59df64b5d521965f1a6656fdab4bd9bf27eb5b27 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Tue, 17 Mar 2015 14:10:20 -0600 Subject: [PATCH 78/99] Remove trailing whitespace --- manual/users/users.tex | 22 +++++++++++----------- manual/users/users_0_cover.tex | 30 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/manual/users/users.tex b/manual/users/users.tex index 56bd8dc6f..2fd6a084f 100644 --- a/manual/users/users.tex +++ b/manual/users/users.tex @@ -1,5 +1,5 @@ %\documentclass[12pt,letterpaper,twoside,onecolumn,portrait,leqno]{book} %leqno= Left numbering for equations -%\documentclass[12pt,letterpaper,twoside,onecolumn,portrait]{book} +%\documentclass[12pt,letterpaper,twoside,onecolumn,portrait]{book} \documentclass[12pt,letterpaper,oneside,onecolumn,portrait]{book} %Kemelli, 3/7/13: to remove bindingoffset \bibliographystyle{plain} \usepackage[Sonny]{fncychap} %Bjornstrup, Sonny @@ -12,8 +12,8 @@ \usepackage{url} \usepackage{fancyvrb} \usepackage{subfig} -\usepackage{wrapfig} -\usepackage{framed} % left bar at the left of the new text added +\usepackage{wrapfig} +\usepackage{framed} % left bar at the left of the new text added \usepackage{booktabs} %nice tables \usepackage{array} %set fixed length in table columns \usepackage{textcomp} %textangle @@ -23,7 +23,7 @@ \usepackage[algoruled,vlined,linesnumbered,english]{algorithm2e} \SetAlFnt{\footnotesize} -\usepackage{titlesec} +\usepackage{titlesec} \titleformat{\section}{\LARGE\sffamily}{\thesection}{1em}{} \titleformat{\subsection}{\Large\sffamily}{\thesubsection}{1em}{} \titleformat{\subsubsection}{\large\sffamily}{\thesubsubsection}{1em}{} @@ -94,7 +94,7 @@ %keywordstyle=\bfseries, % so funciona com basicstyle=\footnotesize,\ttfamily se eu adicionar \usepackage{bold-extra} keywordstyle=\color{blue}, % keyword style commentstyle=\color{dkgreen}\sffamily, % comment style -stringstyle=\color{mauve}, +stringstyle=\color{mauve}, identifierstyle=\bfseries, numberbychapter= true, numberfirstline=false, @@ -120,7 +120,7 @@ morekeywords ={rm,ls}, belowskip = 10pt, %\medskipamount%\smallskipamount, aboveskip =10pt, -} +} \newcommand{\chainsizeresults}{20000} %\newcommand{\new}[1]{{\marginpar{\color{red}\small\raggedright\textsf{\hspace{0pt} NEW}}} \textbf{#1}} @@ -151,9 +151,9 @@ \include{users_2_installation} -\include{users_3_classes} +\include{users_3_classes} -\include{users_4_remarks} +\include{users_4_remarks} \include{users_5_examples} @@ -170,7 +170,7 @@ \include{users_7_lgpl} \include{users_8_fdl} - -\end{appendix} - + +\end{appendix} + \end{document} diff --git a/manual/users/users_0_cover.tex b/manual/users/users_0_cover.tex index 303453881..980b82dc8 100644 --- a/manual/users/users_0_cover.tex +++ b/manual/users/users_0_cover.tex @@ -18,7 +18,7 @@ \begin{center} \begin{LARGE} -\sf\bf +\sf\bf Quantification of Uncertainty for Estimation,\\ Simulation, and Optimization (QUESO)\\ \end{LARGE} @@ -28,21 +28,21 @@ \vfill %$~$\\ %{\bf Lead Developer:}\hfill \\ -%$~\hspace{10pt}$ {\em{Ernesto E. Prudencio}}\hfill\\ +%$~\hspace{10pt}$ {\em{Ernesto E. Prudencio}}\hfill\\ $~$\\ % {\bf Contributors:}\hfill \\ % $~\hspace{10pt}$ {\em{Paul T. Bauman}} \hfill \\ % $~\hspace{10pt}$ {\em{Sai Hung Cheung}} \hfill \\ % $~\hspace{10pt}$ {\em{Kemelli C. Estacio-Hiroms}} \hfill \\ % $~\hspace{10pt}$ {\em{Todd A. Oliver}} \hfill \\ -% $~\hspace{10pt}$ {\em{Ernesto E. Prudencio}} \hfill\\ +% $~\hspace{10pt}$ {\em{Ernesto E. Prudencio}} \hfill\\ % $~\hspace{10pt}$ {\em{Karl W. Schulz}} \hfill \\ % $~\hspace{10pt}$ {\em{Rhys Ulerich}} \hfill \\ \noindent {\bf\sf Editors:}\hfill \\ {\sf Kemelli C. Estacio-Hiroms} \\ -{\sf Ernesto E. Prudencio} \\ +{\sf Ernesto E. Prudencio} \\ \vfill @@ -84,7 +84,7 @@ \centerline{\LARGE\sffamily Abstract} $~$\\ -QUESO stands for Quantification of Uncertainty for Estimation, Simulation and Optimization and consists of +QUESO stands for Quantification of Uncertainty for Estimation, Simulation and Optimization and consists of a collection of algorithms and C++ classes intended for research in uncertainty quantification, including @@ -144,7 +144,7 @@ \addtocontents{toc}{\protect\markboth{}{}} } %\addtocontents{toc}{\protect\thispagestyle{headings}} -\tableofcontents +\tableofcontents %\clearpage %%------------------------------------------------------------------ @@ -237,8 +237,8 @@ \section*{Referencing the QUESO Library} \end{verbatim} % $~$\\ % $~$\\ -% -% +% +% % \centerline{\bf \Queso{} Development Team} \section*{\Queso{} Development Team} @@ -251,13 +251,13 @@ \section*{\Queso{} Development Team} Kenji Miki, Todd A. Oliver, Ernesto E. Prudencio, -Karl W. Schulz, +Karl W. Schulz, Chris Simmons, and Rhys Ulerich. % $~$\\ % $~$\\ -% +% % \centerline{\bf Acknowledgments} \section*{Acknowledgments} @@ -275,16 +275,16 @@ \section*{Acknowledgments} %\clearpage %%------------------------------------------------------------------ %$~$\\ -% +% % $~$\\ -% +% % \centerline{\bf Target Audience} \section*{Target Audience} % \new{ % The target audience for this manual is researchers who are comfortable with UNIX concepts and the command line, have basic knowledge of a programming language, preferably C/C++, and have solid background in Bayesian methods.%, such as Monte Carlo Methods. % } -% % +% % % % The authors have assumed that readers of this manual possess some knowledge of Bayesian methods and are comfortable with UNIX concepts and the command line. % % %%The authors take as their target audience individuals with solid background in statistics, including some familiarity with basic Bayesian methods. @@ -292,11 +292,11 @@ \section*{Target Audience} \new{ % Thanks, Ernesto! -QUESO is a collection of statistical algorithms and programming constructs supporting research into the uncertainty quantification (UQ) of models and their predictions. UQ may be a very complex and time consuming task, involving many steps: +QUESO is a collection of statistical algorithms and programming constructs supporting research into the uncertainty quantification (UQ) of models and their predictions. UQ may be a very complex and time consuming task, involving many steps: decide which physical model(s) to use; decide which reference or experimental data to use; decide which discrepancy models to use; -decide which quantity(ies) of interest (QoI) to compute; +decide which quantity(ies) of interest (QoI) to compute; decide which parameters to calibrate; perform computational runs and collect results; analyze computational results, and eventually reiterate; From 75da9213194ba382d599af8e123c121d869f6634 Mon Sep 17 00:00:00 2001 From: Damon McDougall Date: Wed, 18 Mar 2015 17:16:04 -0600 Subject: [PATCH 79/99] Remove all trailing whitespace --- examples/bimodal/src/bimodal_likelihood.C | 12 +- .../brian_williams_verif1/src/verif1_gsl.C | 4 +- .../brian_williams_verif2/src/verif2_gsl.C | 4 +- .../brian_williams_verif3/src/verif3_gsl.C | 8 +- .../brian_williams_verif5/src/verif5_gsl.C | 4 +- .../brian_williams_verif6/src/verif6_gsl.C | 2 +- examples/gpmsaTower/src/tower_gsl.C | 10 +- examples/gravity/src/gravity_main.C | 12 +- examples/hysteretic/src/example_compute.C | 48 +-- examples/hysteretic/src/example_hyst.C | 32 +- examples/hysteretic/src/example_likelihood.C | 14 +- examples/hysteretic/src/example_main.C | 8 +- .../infoTheoryProblem/src/exInfoTheory_gsl.C | 10 +- examples/modal/src/example_compute.C | 12 +- examples/modal/src/example_likelihood.C | 10 +- examples/modal/src/example_main.C | 16 +- .../src/simple_sfp_example_compute.C | 24 +- .../src/simple_sfp_example_qoi.C | 10 +- .../src/example_compute.C | 12 +- .../src/example_likelihood.C | 12 +- .../src/example_main.C | 2 +- .../src/exStatisticalForwardProblem_gsl.C | 6 +- .../src/exStatisticalInverseProblem_gsl.C | 6 +- .../src/exStatisticalInverseProblem1_gsl.C | 6 +- .../validationCycle/originalData/global.c | 42 +- examples/validationCycle2/src/tga2_appl.C | 4 +- .../validationCycle2/src/tga2_likelihood.C | 50 +-- examples/validationCycle2/src/tga2_qoi.C | 16 +- src/basic/inc/ArrayOfSequences.h | 76 ++-- src/basic/inc/BoxSubset.h | 24 +- src/basic/inc/ConcatenationSubset.h | 12 +- src/basic/inc/ConstantScalarFunction.h | 8 +- src/basic/inc/ConstantVectorFunction.h | 10 +- src/basic/inc/DiscreteSubset.h | 18 +- src/basic/inc/GenericScalarFunction.h | 14 +- src/basic/inc/GenericVectorFunction.h | 20 +- src/basic/inc/InstantiateIntersection.h | 2 +- src/basic/inc/IntersectionSubset.h | 24 +- src/basic/inc/ScalarFunctionSynchronizer.h | 22 +- src/basic/inc/ScalarSequence.h | 228 +++++----- src/basic/inc/SequenceOfVectors.h | 166 +++---- src/basic/inc/SequenceStatisticalOptions.h | 104 ++--- src/basic/inc/VectorFunction.h | 32 +- src/basic/inc/VectorFunctionSynchronizer.h | 18 +- src/basic/inc/VectorSequence.h | 150 +++---- src/basic/inc/VectorSet.h | 28 +- src/basic/inc/VectorSpace.h | 58 +-- src/basic/inc/VectorSubset.h | 16 +- src/basic/src/ArrayOfSequences.C | 2 +- src/basic/src/ScalarSequence.C | 26 +- src/basic/src/SequenceOfVectors.C | 22 +- src/basic/src/SequenceStatisticalOptions.C | 2 +- src/basic/src/VectorSpace.C | 4 +- src/contrib/ANN/ann2fig/ann2fig.cpp | 14 +- src/contrib/ANN/include/ANN/ANN.h | 28 +- src/contrib/ANN/include/ANN/ANNperf.h | 12 +- src/contrib/ANN/include/ANN/ANNx.h | 4 +- src/contrib/ANN/sample/ann_sample.cpp | 6 +- src/contrib/ANN/src/ANN.cpp | 14 +- src/contrib/ANN/src/bd_fix_rad_search.cpp | 4 +- src/contrib/ANN/src/bd_pr_search.cpp | 4 +- src/contrib/ANN/src/bd_search.cpp | 4 +- src/contrib/ANN/src/bd_tree.cpp | 14 +- src/contrib/ANN/src/bd_tree.h | 8 +- src/contrib/ANN/src/brute.cpp | 4 +- src/contrib/ANN/src/kd_dump.cpp | 6 +- src/contrib/ANN/src/kd_fix_rad_search.cpp | 4 +- src/contrib/ANN/src/kd_fix_rad_search.h | 4 +- src/contrib/ANN/src/kd_pr_search.cpp | 4 +- src/contrib/ANN/src/kd_pr_search.h | 4 +- src/contrib/ANN/src/kd_search.cpp | 4 +- src/contrib/ANN/src/kd_search.h | 4 +- src/contrib/ANN/src/kd_split.cpp | 4 +- src/contrib/ANN/src/kd_split.h | 4 +- src/contrib/ANN/src/kd_tree.cpp | 14 +- src/contrib/ANN/src/kd_tree.h | 4 +- src/contrib/ANN/src/kd_util.cpp | 6 +- src/contrib/ANN/src/kd_util.h | 4 +- src/contrib/ANN/src/perf.cpp | 4 +- src/contrib/ANN/src/pr_queue.h | 4 +- src/contrib/ANN/src/pr_queue_k.h | 14 +- src/contrib/ANN/test/ann_test.cpp | 10 +- src/contrib/ANN/test/rand.cpp | 24 +- src/contrib/ANN/test/rand.h | 4 +- src/core/inc/BasicPdfsBase.h | 16 +- src/core/inc/BasicPdfsBoost.h | 20 +- src/core/inc/BasicPdfsGsl.h | 12 +- src/core/inc/Defines.h | 38 +- src/core/inc/DistArray.h | 52 +-- src/core/inc/Environment.h | 6 +- src/core/inc/EnvironmentOptions.h | 50 +-- src/core/inc/GslOptimizer.h | 4 +- src/core/inc/GslVector.h | 126 +++--- .../inc/InfiniteDimensionalLikelihoodBase.h | 4 +- .../InfiniteDimensionalMCMCSamplerOptions.h | 4 +- src/core/inc/Map.h | 40 +- src/core/inc/Matrix.h | 76 ++-- src/core/inc/MpiComm.h | 130 +++--- src/core/inc/OptimizerMonitor.h | 6 +- src/core/inc/RngBase.h | 36 +- src/core/inc/RngBoost.h | 74 ++-- src/core/inc/RngGsl.h | 62 +-- src/core/inc/TeuchosMatrix.h | 282 ++++++------ src/core/inc/TeuchosVector.h | 190 ++++---- src/core/inc/Vector.h | 84 ++-- src/core/inc/exceptions.h | 2 +- src/core/src/BasicPdfsGsl.C | 2 +- src/core/src/DistArray.C | 2 +- src/core/src/Environment.C | 54 +-- src/core/src/GslOptimizer.C | 4 +- src/core/src/GslVector.C | 2 +- .../src/InfiniteDimensionalLikelihoodBase.C | 4 +- src/core/src/InfiniteDimensionalMCMCSampler.C | 10 +- .../InfiniteDimensionalMCMCSamplerOptions.C | 6 +- .../src/LibMeshNegativeLaplacianOperator.C | 8 +- src/core/src/MpiComm.C | 18 +- src/core/src/RngBoost.C | 8 +- src/core/src/RngGsl.C | 2 +- src/core/src/TeuchosMatrix.C | 406 +++++++++--------- src/core/src/TeuchosVector.C | 124 +++--- src/core/src/version.C | 2 +- src/gp/inc/GPMSA.h | 2 +- src/gp/inc/GPMSAOptions.h | 4 +- src/gp/inc/GpmsaComputerModel.h | 2 +- src/gp/src/ExperimentModelOptions.C | 4 +- src/gp/src/GPMSA.C | 2 +- src/gp/src/GcmJointTildeInfo.C | 2 +- src/gp/src/GcmSimulationInfo.C | 6 +- src/gp/src/GcmSimulationTildeInfo.C | 2 +- src/gp/src/GpmsaComputerModel.C | 44 +- src/gp/src/GpmsaComputerModelOptions.C | 2 +- src/gp/src/SimulationModel.C | 6 +- src/gp/src/SimulationModelOptions.C | 4 +- src/gp/src/SimulationStorage.C | 2 +- src/misc/inc/1D1DFunction.h | 254 +++++------ src/misc/inc/1DQuadrature.h | 170 ++++---- src/misc/inc/2dArrayOfStuff.h | 20 +- src/misc/inc/ArrayOfOneDGrids.h | 30 +- src/misc/inc/ArrayOfOneDTables.h | 18 +- src/misc/inc/AsciiTable.h | 16 +- src/misc/inc/Fft.h | 64 +-- src/misc/inc/OneDGrid.h | 12 +- src/misc/inc/StdOneDGrid.h | 14 +- src/misc/inc/UniformOneDGrid.h | 16 +- src/misc/src/1D1DFunction.C | 8 +- src/misc/src/1DQuadrature.C | 32 +- src/misc/src/ArrayOfOneDTables.C | 2 +- src/misc/src/AsciiTable.C | 2 +- src/misc/src/ComplexFft.C | 4 +- src/misc/src/Miscellaneous.C | 4 +- src/misc/src/RealFft.C | 4 +- src/misc/src/UniformOneDGrid.C | 2 +- src/stats/inc/BayesianJointPdf.h | 28 +- src/stats/inc/BetaJointPdf.h | 8 +- src/stats/inc/BetaVectorRV.h | 18 +- src/stats/inc/BetaVectorRealizer.h | 14 +- src/stats/inc/ConcatenatedJointPdf.h | 30 +- src/stats/inc/ConcatenatedVectorRV.h | 14 +- src/stats/inc/ConcatenatedVectorRealizer.h | 12 +- .../inc/ExponentialMatrixCovarianceFunction.h | 14 +- .../inc/ExponentialScalarCovarianceFunction.h | 22 +- src/stats/inc/FiniteDistribution.h | 16 +- src/stats/inc/GammaJointPdf.h | 8 +- src/stats/inc/GammaVectorRV.h | 24 +- src/stats/inc/GammaVectorRealizer.h | 16 +- src/stats/inc/GaussianJointPdf.h | 34 +- src/stats/inc/GaussianVectorCdf.h | 20 +- src/stats/inc/GaussianVectorMdf.h | 16 +- src/stats/inc/GaussianVectorRV.h | 26 +- src/stats/inc/GaussianVectorRealizer.h | 38 +- src/stats/inc/GenericJointPdf.h | 6 +- .../inc/GenericMatrixCovarianceFunction.h | 8 +- .../inc/GenericScalarCovarianceFunction.h | 8 +- src/stats/inc/GenericVectorCdf.h | 18 +- src/stats/inc/GenericVectorMdf.h | 12 +- src/stats/inc/GenericVectorRV.h | 24 +- src/stats/inc/GenericVectorRealizer.h | 14 +- src/stats/inc/HessianCovMatricesTKGroup.h | 16 +- src/stats/inc/InfoTheory.h | 28 +- src/stats/inc/InverseGammaJointPdf.h | 4 +- src/stats/inc/InverseGammaVectorRV.h | 18 +- src/stats/inc/InverseGammaVectorRealizer.h | 10 +- src/stats/inc/JeffreysJointPdf.h | 4 +- src/stats/inc/JeffreysVectorRV.h | 6 +- src/stats/inc/JeffreysVectorRealizer.h | 12 +- src/stats/inc/JointPdf.h | 40 +- src/stats/inc/LogNormalJointPdf.h | 26 +- src/stats/inc/LogNormalVectorRV.h | 14 +- src/stats/inc/LogNormalVectorRealizer.h | 26 +- src/stats/inc/MLSampling.h | 98 ++--- src/stats/inc/MLSamplingLevelOptions.h | 148 +++---- src/stats/inc/MLSamplingOptions.h | 28 +- src/stats/inc/MarkovChainPositionData.h | 28 +- src/stats/inc/MatrixCovarianceFunction.h | 28 +- src/stats/inc/MetropolisHastingsSGOptions.h | 36 +- src/stats/inc/ModelValidation.h | 12 +- src/stats/inc/MonteCarloSG.h | 40 +- src/stats/inc/MonteCarloSGOptions.h | 38 +- src/stats/inc/PoweredJointPdf.h | 18 +- src/stats/inc/SampledScalarCdf.h | 30 +- src/stats/inc/SampledVectorCdf.h | 26 +- src/stats/inc/SampledVectorMdf.h | 16 +- src/stats/inc/ScalarCdf.h | 30 +- src/stats/inc/ScalarCovarianceFunction.h | 20 +- src/stats/inc/ScalarGaussianRandomField.h | 50 +-- src/stats/inc/SequentialVectorRealizer.h | 14 +- src/stats/inc/StatisticalForwardProblem.h | 58 +-- .../inc/StatisticalForwardProblemOptions.h | 44 +- src/stats/inc/StatisticalInverseProblem.h | 2 +- .../inc/StatisticalInverseProblemOptions.h | 40 +- src/stats/inc/StdScalarCdf.h | 26 +- src/stats/inc/TKGroup.h | 28 +- src/stats/inc/UniformJointPdf.h | 4 +- src/stats/inc/UniformVectorRV.h | 6 +- src/stats/inc/UniformVectorRealizer.h | 12 +- src/stats/inc/ValidationCycle.h | 50 +-- src/stats/inc/VectorCdf.h | 32 +- src/stats/inc/VectorGaussianRandomField.h | 46 +- src/stats/inc/VectorMdf.h | 26 +- src/stats/inc/VectorRV.h | 22 +- src/stats/inc/VectorRealizer.h | 14 +- src/stats/inc/WignerJointPdf.h | 8 +- src/stats/inc/WignerVectorRV.h | 16 +- src/stats/inc/WignerVectorRealizer.h | 12 +- src/stats/src/BetaVectorRV.C | 30 +- .../src/ExponentialMatrixCovarianceFunction.C | 2 +- .../src/ExponentialScalarCovarianceFunction.C | 2 +- src/stats/src/GammaVectorRV.C | 26 +- src/stats/src/GammaVectorRealizer.C | 36 +- src/stats/src/GaussianVectorRealizer.C | 2 +- .../src/GenericMatrixCovarianceFunction.C | 2 +- .../src/GenericScalarCovarianceFunction.C | 2 +- src/stats/src/InverseGammaVectorRV.C | 22 +- src/stats/src/LogNormalVectorRV.C | 22 +- src/stats/src/LogNormalVectorRealizer.C | 4 +- src/stats/src/MLSampling.C | 16 +- src/stats/src/MLSamplingLevelOptions.C | 6 +- src/stats/src/MLSamplingOptions.C | 4 +- src/stats/src/MetropolisHastingsSGOptions.C | 4 +- src/stats/src/MonteCarloSG.C | 18 +- src/stats/src/MonteCarloSGOptions.C | 12 +- src/stats/src/SampledScalarCdf.C | 6 +- src/stats/src/SampledVectorCdf.C | 2 +- src/stats/src/ScalarGaussianRandomField.C | 2 +- src/stats/src/StatisticalForwardProblem.C | 4 +- .../src/StatisticalForwardProblemOptions.C | 6 +- .../src/StatisticalInverseProblemOptions.C | 2 +- .../src/TransformedScaledCovMatrixTKGroup.C | 2 +- src/stats/src/UniformVectorRealizer.C | 2 +- src/stats/src/VectorCdf.C | 2 +- src/stats/src/VectorGaussianRandomField.C | 4 +- src/stats/src/VectorRV.C | 10 +- src/stats/src/WignerJointPdf.C | 2 +- src/stats/src/WignerVectorRealizer.C | 4 +- test/gsl_tests/get_min_max_vec.C | 2 +- test/gsl_tests/get_set_row_column.C | 4 +- test/gsl_tests/inverse_power_method.C | 4 +- test/gsl_tests/multiple_rhs_matrix_solve.C | 2 +- test/gsl_tests/power_method.C | 2 +- test/t03_sequence/example_compute.C | 6 +- test/t03_sequence/example_main.C | 6 +- test/t04_bimodal/example_likelihood.C | 2 +- test/test_GslVector/test_uqGslVector.C | 2 +- test/test_Regression/test_jeffreys.C | 2 +- .../test_LlhdTargetOutput.C | 8 +- test/test_exception/test_exception.C | 6 +- test/test_infinite/test_inf_gaussian.C | 4 +- 267 files changed, 3255 insertions(+), 3255 deletions(-) diff --git a/examples/bimodal/src/bimodal_likelihood.C b/examples/bimodal/src/bimodal_likelihood.C index 3693351c3..ddd688a5a 100644 --- a/examples/bimodal/src/bimodal_likelihood.C +++ b/examples/bimodal/src/bimodal_likelihood.C @@ -41,9 +41,9 @@ double likelihoodRoutine( functionDataPtr || gradVector || hessianMatrix || - hessianEffect) {}; // just to remove compiler warning + hessianEffect) {}; // just to remove compiler warning - double returnValue = 0.; + double returnValue = 0.; double x = paramValues[0]; double mean1 = 10.; double sigma1 = 1.; @@ -55,8 +55,8 @@ double likelihoodRoutine( double y2 = (x-mean2)*(x-mean2)/(2.*sigma2*sigma2); double z2 = (1./sigma2/sqrt(2*M_PI))*exp(-y2); - double resultValue = -2*log((z1+2.*z2)/3.); - + double resultValue = -2*log((z1+2.*z2)/3.); + if (resultValue == INFINITY) { //std::cerr << "WARNING In likelihoodRoutine" // << ", fullRank " << paramValues.env().fullRank() @@ -72,7 +72,7 @@ double likelihoodRoutine( } returnValue = -.5*resultValue; - + if (paramValues.env().exceptionalCircumstance()) { if ((paramValues.env().subDisplayFile() ) && @@ -84,5 +84,5 @@ double likelihoodRoutine( } } - return returnValue; + return returnValue; } diff --git a/examples/brian_williams_verif1/src/verif1_gsl.C b/examples/brian_williams_verif1/src/verif1_gsl.C index 457aace4d..de1b964a3 100644 --- a/examples/brian_williams_verif1/src/verif1_gsl.C +++ b/examples/brian_williams_verif1/src/verif1_gsl.C @@ -76,7 +76,7 @@ void solveSip(const uqFullEnvironmentClass& env, bool useML) unsigned int n = 400; uqVectorSpaceClass dataSpace(env, "data_", n, NULL); - double sigmaTotal = 4229.55; + double sigmaTotal = 4229.55; std::set tmpSet; tmpSet.insert(env.subId()); @@ -187,7 +187,7 @@ double likelihoodRoutine( // Just to eliminate INTEL compiler warnings } - struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; + struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; uqGslVectorClass aVec(*(likelihoodData->aVec)); uqGslVectorClass bVec(*(likelihoodData->bVec)); unsigned int p = aVec.sizeLocal(); diff --git a/examples/brian_williams_verif2/src/verif2_gsl.C b/examples/brian_williams_verif2/src/verif2_gsl.C index 61b814265..509f3af3b 100644 --- a/examples/brian_williams_verif2/src/verif2_gsl.C +++ b/examples/brian_williams_verif2/src/verif2_gsl.C @@ -73,7 +73,7 @@ void solveSip(const uqFullEnvironmentClass& env) //////////////////////////////////////////////////////// unsigned int n = 5; uqVectorSpaceClass dataSpace(env, "data_", n, NULL); - + uqGslVectorClass yMeanVec(dataSpace.zeroVector()); double tmp = scalarProduct(aVec,xGiven); for (unsigned int i = 0; i < n; ++i) { @@ -229,7 +229,7 @@ double likelihoodRoutine( // Just to eliminate INTEL compiler warnings } - struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; + struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; uqGslVectorClass aVec(*(likelihoodData->aVec)); unsigned int p = aVec.sizeLocal(); double sigmaEps = likelihoodData->sigmaEps; diff --git a/examples/brian_williams_verif3/src/verif3_gsl.C b/examples/brian_williams_verif3/src/verif3_gsl.C index 25efcbce5..f06c71d3d 100644 --- a/examples/brian_williams_verif3/src/verif3_gsl.C +++ b/examples/brian_williams_verif3/src/verif3_gsl.C @@ -94,10 +94,10 @@ void solveSips(const uqFullEnvironmentClass& env) epsCovMat(0,0) = sigmaEps*sigmaEps; uqGslVectorClass epsSample (paramSpace.zeroVector()); uqGaussianVectorRVClass epsRv("eps_", paramSpace, epsMeanVec, epsCovMat); - + unsigned int n = 5; uqVectorSpaceClass dataSpace(env, "data_", n, NULL); - + uqGslMatrixClass zMat (env,paramSpace.map(),n); uqGslMatrixClass zMatTranspose(env,dataSpace.map (),p); @@ -355,7 +355,7 @@ double likelihoodRoutineForX0( // Just to eliminate INTEL compiler warnings } - struct likelihoodDataStructForX0* likelihoodDataForX0 = (likelihoodDataStructForX0 *) functionDataPtr; + struct likelihoodDataStructForX0* likelihoodDataForX0 = (likelihoodDataStructForX0 *) functionDataPtr; uqGslMatrixClass zMat(*(likelihoodDataForX0->zMat)); unsigned int p = zMat.numRowsLocal(); double sigmaEps = likelihoodDataForX0->sigmaEps; @@ -501,7 +501,7 @@ double likelihoodRoutineForX( // Just to eliminate INTEL compiler warnings } - struct likelihoodDataStructForX* likelihoodDataForX = (likelihoodDataStructForX *) functionDataPtr; + struct likelihoodDataStructForX* likelihoodDataForX = (likelihoodDataStructForX *) functionDataPtr; uqGslMatrixClass zMat(*(likelihoodDataForX->zMat)); unsigned int p = zMat.numRowsLocal(); double sigmaEps = likelihoodDataForX->sigmaEps; diff --git a/examples/brian_williams_verif5/src/verif5_gsl.C b/examples/brian_williams_verif5/src/verif5_gsl.C index 633ff81f7..ddb6801ad 100644 --- a/examples/brian_williams_verif5/src/verif5_gsl.C +++ b/examples/brian_williams_verif5/src/verif5_gsl.C @@ -74,7 +74,7 @@ void solveSip(const uqFullEnvironmentClass& env, bool useML) unsigned int nAll = 100000; uqVectorSpaceClass dataSpaceAll(env, "data_", nAll, NULL); - double sigmaTotal = bVec[0]/2.; + double sigmaTotal = bVec[0]/2.; std::set tmpSet; tmpSet.insert(env.subId()); @@ -202,7 +202,7 @@ double likelihoodRoutine( // Just to eliminate INTEL compiler warnings } - struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; + struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; uqGslVectorClass bVec(*(likelihoodData->bVec)); unsigned int p = bVec.sizeLocal(); double sigmaTotal = likelihoodData->sigmaTotal; diff --git a/examples/brian_williams_verif6/src/verif6_gsl.C b/examples/brian_williams_verif6/src/verif6_gsl.C index 70bee9bb8..66f72347e 100644 --- a/examples/brian_williams_verif6/src/verif6_gsl.C +++ b/examples/brian_williams_verif6/src/verif6_gsl.C @@ -211,7 +211,7 @@ double likelihoodRoutine( // Just to eliminate INTEL compiler warnings } - struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; + struct likelihoodDataStruct* likelihoodData = (likelihoodDataStruct *) functionDataPtr; std::vector& as = *(likelihoodData->as); uqGslVectorClass bVec(*(likelihoodData->bVec)); unsigned int p = bVec.sizeLocal(); diff --git a/examples/gpmsaTower/src/tower_gsl.C b/examples/gpmsaTower/src/tower_gsl.C index 2df6fbbee..c2856a9c4 100644 --- a/examples/gpmsaTower/src/tower_gsl.C +++ b/examples/gpmsaTower/src/tower_gsl.C @@ -406,7 +406,7 @@ void compute(const uqFullEnvironmentClass& env, bool useExperiments, bool useML) DobsMats[i]->setColumn(colId,DobsCol); } } - + //*********************************************************************** // Normalize 'DsimMat' and all 'DobsMats' //*********************************************************************** @@ -451,7 +451,7 @@ void compute(const uqFullEnvironmentClass& env, bool useExperiments, bool useML) for (unsigned int i = 0; i < paper_n; ++i) { Kmats_interp_spaces[i] = new uqVectorSpaceClass(env,"Kmats_interp_spaces_",experimentStoragePtr->n_ys_transformed()[i],NULL); Kmats_interp [i] = new uqGslMatrixClass(env,Kmats_interp_spaces[i]->map(),paper_p_eta); - Kmats_interp [i]->matlabLinearInterpExtrap(extraSimulationGridVec,simulationModel.Kmat_eta(),*(extraExperimentGridVecs[i])); // Important matrix (K_eta on paper) + Kmats_interp [i]->matlabLinearInterpExtrap(extraSimulationGridVec,simulationModel.Kmat_eta(),*(extraExperimentGridVecs[i])); // Important matrix (K_eta on paper) Kmats_interp[i]->setPrintHorizontally(false); if ((env.subDisplayFile()) && (env.displayVerbosity() >= 3)) { *env.subDisplayFile() << "In compute()" @@ -546,7 +546,7 @@ void compute(const uqFullEnvironmentClass& env, bool useExperiments, bool useML) diagVec[ 5] = 0.01; // rho_w_2_1 = diagVec[ 6] = 0.01; // rho_w_2_2 = diagVec[ 7] = 2500.; // lambda_s_1 = lamWs - diagVec[ 8] = 2500; // lambda_s_2 = + diagVec[ 8] = 2500; // lambda_s_2 = diagVec[ 9] = 2500; // lambda_y = lamOs diagVec[10] = 2500; // lambda_v_1 = lamVz diagVec[11] = 0.01; // rho_v_1_1 = betaV @@ -574,7 +574,7 @@ void compute(const uqFullEnvironmentClass& env, bool useExperiments, bool useML) diagVec[ 5] = 0.01; // rho_w_2_1 = diagVec[ 6] = 0.01; // rho_w_2_2 = diagVec[ 7] = 2500.; // lambda_s_1 = lamWs - diagVec[ 8] = 2500; // lambda_s_2 = + diagVec[ 8] = 2500; // lambda_s_2 = } uqGslMatrixClass totalInitialProposalCovMatrix(diagVec); // todo_r @@ -605,7 +605,7 @@ void compute(const uqFullEnvironmentClass& env, bool useExperiments, bool useML) for (unsigned int i = 0; i < dim1; ++i) { predictionGrid1Vec[i] = ((double) i)/((double) (dim1-1)); } - + unsigned int dim2 = 16; uqVectorSpaceClass predictionGrid2Space(env, "predictionGrid2_", dim2, NULL); uqGslVectorClass predictionGrid2Vec(predictionGrid2Space.zeroVector()); diff --git a/examples/gravity/src/gravity_main.C b/examples/gravity/src/gravity_main.C index 640e57256..d8d78ebd4 100644 --- a/examples/gravity/src/gravity_main.C +++ b/examples/gravity/src/gravity_main.C @@ -23,17 +23,17 @@ *------------------------------------------------------------------- */ /*------------------------------------------------------------------ - * Brief description of this file: - * + * Brief description of this file: + * * This is an example of how to use QUESO classes and algorithms in order to define and solve * a statistical inverse problem (SIP) and/or a statistical forward problem (SFP). - * The SIP consists on calibrating the magnitude 'g' of acceleration gravity using + * The SIP consists on calibrating the magnitude 'g' of acceleration gravity using * measurements of the time that it takes for an object in free fall to reach the ground from - * a given height and zero initial velocity. The solution of the SIP is the posterior + * a given height and zero initial velocity. The solution of the SIP is the posterior * probability density function (PDF) of 'g'. - * The SFP consists of calculating the maximum distance traveled by an object in projectile + * The SFP consists of calculating the maximum distance traveled by an object in projectile * motion. The posterior PDF of 'g' from the SIP might be used as input to the SFP. - * + * * The code consists of 7 files: * - 'gravity_main.C' (this file) * - 'gravity_compute.C' (the driving application code) diff --git a/examples/hysteretic/src/example_compute.C b/examples/hysteretic/src/example_compute.C index ed3552d95..a0b452fb5 100644 --- a/examples/hysteretic/src/example_compute.C +++ b/examples/hysteretic/src/example_compute.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * *-------------------------------------------------------------------------- *-------------------------------------------------------------------------- */ @@ -42,12 +42,12 @@ #include void compute(const QUESO::FullEnvironment& env) { - + struct timeval timevalNow; gettimeofday(&timevalNow, NULL); std::cout << std::endl << "Beginning run of 'Hysteretic' example at " << ctime(&timevalNow.tv_sec); - + //------------------------------------------------------ // Step 1 of 5: Instantiate the parameter space //------------------------------------------------------ @@ -81,9 +81,9 @@ void compute(const QUESO::FullEnvironment& env) { //------------------------------------------------------ // Step 3 of 5: Instantiate the likelihood function object //------------------------------------------------------ - std::cout << "\tInstantiating the Likelihood; calling internally the hysteretic model" - << std::endl; - + std::cout << "\tInstantiating the Likelihood; calling internally the hysteretic model" + << std::endl; + likelihoodRoutine_DataType likelihoodRoutine_Data; likelihoodRoutine_Data.floor.resize(4,NULL); unsigned int numTimeSteps = 401; @@ -107,7 +107,7 @@ void compute(const QUESO::FullEnvironment& env) { (*likelihoodRoutine_Data.floor[0])[numObservations]=tmpA; numObservations++; } - + numObservations=0; FILE *inp1_2; inp1_2=fopen("measured_data1_2.txt","r"); @@ -115,8 +115,8 @@ void compute(const QUESO::FullEnvironment& env) { (*likelihoodRoutine_Data.floor[1])[numObservations]=tmpA; numObservations++; } - - numObservations=0; + + numObservations=0; FILE *inp1_3; inp1_3=fopen("measured_data1_3.txt","r"); while (fscanf(inp1_3,"%lf",&tmpA) != EOF) { @@ -142,18 +142,18 @@ void compute(const QUESO::FullEnvironment& env) { //------------------------------------------------------ // Step 4 of 5: Instantiate the inverse problem //------------------------------------------------------ - std::cout << "\tInstantiating the SIP" << std::endl; - + std::cout << "\tInstantiating the SIP" << std::endl; + QUESO::UniformVectorRV priorRvA("priorA_", paramDomainA); QUESO::GslVector meanVec(paramSpaceB.zeroVector()); QUESO::GslVector diagVec(paramSpaceB.zeroVector()); - + diagVec.cwSet(0.6*0.6); - + QUESO::GslMatrix covMatrix(diagVec); - + QUESO::GaussianVectorRV priorRvB("priorB_", paramDomainB,meanVec,covMatrix); @@ -162,17 +162,17 @@ void compute(const QUESO::FullEnvironment& env) { QUESO::GenericVectorRV postRv("post_", paramSpace); - + QUESO::StatisticalInverseProblem ip("", NULL, priorRv, likelihoodFunctionObj, postRv); //------------------------------------------------------ // Step 5 of 5: Solve the inverse problem //------------------------------------------------------ - std::cout << "\tSolving the SIP with Multilevel method" << std::endl; - + std::cout << "\tSolving the SIP with Multilevel method" << std::endl; + ip.solveWithBayesMLSampling(); - + gettimeofday(&timevalNow, NULL); std::cout << "Ending run of 'Hysteretic' example at " << ctime(&timevalNow.tv_sec) << std::endl; @@ -231,7 +231,7 @@ void debug_hyst(const QUESO::FullEnvironment& env) { QUESO::SequenceOfVectors u (floorSpace,numTimeSteps,""); // absolute displacement QUESO::SequenceOfVectors ud (floorSpace,numTimeSteps,""); // velocity QUESO::SequenceOfVectors udd (floorSpace,numTimeSteps,""); // acceleration - QUESO::SequenceOfVectors resfor(floorSpace,numTimeSteps,""); // restoring force + QUESO::SequenceOfVectors resfor(floorSpace,numTimeSteps,""); // restoring force QUESO::SequenceOfVectors ru (floorSpace,numTimeSteps,""); // relative displacement u.setPositionValues (0,floorSpace.zeroVector()); @@ -257,14 +257,14 @@ void debug_hyst(const QUESO::FullEnvironment& env) { udd, resfor, ru); - + std::set auxSet; auxSet.insert(0); - + // Writing some data to the file 'outputData/cpp_output.m' std::ofstream myFile; myFile.open ("outputData/cpp_output.m"); - + // Write 't_cpp' myFile << "t_cpp = zeros(" << 1 << "," << numTimeSteps << ");\n" << "t_cpp = ["; @@ -344,6 +344,6 @@ void debug_hyst(const QUESO::FullEnvironment& env) { myFile << "];" << std::endl; myFile.close(); - + return; } diff --git a/examples/hysteretic/src/example_hyst.C b/examples/hysteretic/src/example_hyst.C index 29211c5d7..091c13877 100644 --- a/examples/hysteretic/src/example_hyst.C +++ b/examples/hysteretic/src/example_hyst.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * *-------------------------------------------------------------------------- *-------------------------------------------------------------------------- */ @@ -68,7 +68,7 @@ void restoringForce( } double xu = inpParam->xu; - double yu = inpParam->yu; + double yu = inpParam->yu; double k = inpParam->k; double r = inpParam->r; double inter_y = inpParam->inter_y; @@ -162,7 +162,7 @@ void ckmatrix(const QUESO::GslVector& vec, QUESO::GslMatrix& mat) //------------------------------------------------------ // The hysteretic model. // function [u,ud,udd,ru,resfor,a]=hysteretic_model_example3(thi,a); -// a is the total acceleration at the base of the building +// a is the total acceleration at the base of the building //------------------------------------------------------ void hystereticModel( const QUESO::BaseEnvironment& env, @@ -225,7 +225,7 @@ void hystereticModel( ckmatrix(kInputVec,tmp_mat); QUESO::GslMatrix C(rho*M + gamma*tmp_mat); - double gammaHere = 0.5; + double gammaHere = 0.5; double beta = 0.25; // Average acceleration method double bdt = beta*dt; @@ -275,7 +275,7 @@ void hystereticModel( } QUESO::GslMatrix invM (invMvec); auxUddPosition=invM*(auxPPosition-C*ud0-auxFsPosition); - + udd.setPositionValues(0,auxUddPosition); QUESO::GslMatrix A ((1./bdt)*M + g_b*C); @@ -302,7 +302,7 @@ void hystereticModel( p.getPositionValues (i+1,auxVec2); dpi = auxVec2 - auxVec1; dpgi = dpi + A*udi + B*uddi; - + // Solve for duj from kgi and dpgi using Newton-Raphson // BEGIN NEWTON RAPHSON resfor.getPositionValues(i,resfor0); @@ -310,23 +310,23 @@ void hystereticModel( QUESO::GslVector dR(dpgi); unsigned int j = 0; QUESO::GslVector duj(dofSpace.zeroVector()); - + QUESO::GslVector ru0(dofSpace.zeroVector()); QUESO::GslVector rv0(dofSpace.zeroVector()); ui.matlabDiff (1,ui[0], ru0); //ru0 = [ui(1); diff(ui) ]; - udi.matlabDiff(1,udi[0],rv0); //rv0 = [udi(1); diff(udi)]; - - unsigned int aOutput = 1; + udi.matlabDiff(1,udi[0],rv0); //rv0 = [udi(1); diff(udi)]; + + unsigned int aOutput = 1; QUESO::GslVector ruj(dofSpace.zeroVector()); QUESO::GslVector rvj(dofSpace.zeroVector()); QUESO::GslVector uj (dofSpace.zeroVector()); QUESO::GslVector vj (dofSpace.zeroVector()); - + while (true) { j = j + 1; if (j > 10000) { // error('Newton Raphson is not converging'); - aOutput=0; + aOutput=0; break; } if (aOutput == 0) { @@ -350,12 +350,12 @@ void hystereticModel( if (useLinear == false) { uj.matlabDiff(1,uj[0],ruj); //ruj = [uj(1); diff(uj)]; vj.matlabDiff(1,vj[0],rvj); //rvj = [vj(1); diff(vj)]; - + for (unsigned int w = 0; w < ndof; ++w) { restoringForce(ruj[w],ru0[w],rvj[w],rv0[w],resfor0[w],¶m[w], NULL, &auxResforPosition[w], &kTdiag[w], ¶m[w]); } - + resfor.setPositionValues(i+1,auxResforPosition); auxResforPosition.matlabDiff(0,-auxResforPosition[ndof-1],fsj); //fsj = [-diff(resfor(:,i+1)); resfor(ndof,i+1)]; fsj *= -1.; @@ -375,7 +375,7 @@ void hystereticModel( break; } } // end while - + fs.setPositionValues(i+1,fsj); if (useLinear == false) { ru.setPositionValues(i+1,ruj); diff --git a/examples/hysteretic/src/example_likelihood.C b/examples/hysteretic/src/example_likelihood.C index f0c475e92..29585ed69 100644 --- a/examples/hysteretic/src/example_likelihood.C +++ b/examples/hysteretic/src/example_likelihood.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * *-------------------------------------------------------------------------- *-------------------------------------------------------------------------- */ @@ -47,9 +47,9 @@ double likelihoodRoutine( "example_likelihood()", "invalid parameter size"); - const std::vector* >& + const std::vector* >& floor = ((likelihoodRoutine_DataType *) functionDataPtr)->floor; - const std::vector& + const std::vector& accel = ((likelihoodRoutine_DataType *) functionDataPtr)->accel; unsigned int numFloors = floor.size(); @@ -102,7 +102,7 @@ double likelihoodRoutine( QUESO::SequenceOfVectors u (floorSpace,numTimeSteps,""); // absolute displacement QUESO::SequenceOfVectors ud (floorSpace,numTimeSteps,""); // velocity QUESO::SequenceOfVectors udd (floorSpace,numTimeSteps,""); // acceleration - QUESO::SequenceOfVectors resfor(floorSpace,numTimeSteps,""); // restoring force + QUESO::SequenceOfVectors resfor(floorSpace,numTimeSteps,""); // restoring force QUESO::SequenceOfVectors ru (floorSpace,numTimeSteps,""); // relative displacement QUESO::GslVector massVec(floorSpace.zeroVector()); @@ -122,7 +122,7 @@ double likelihoodRoutine( udd, resfor, ru); - + QUESO::GslVector auxVec(floorSpace.zeroVector()); double sum = 0.; @@ -134,5 +134,5 @@ double likelihoodRoutine( } double result = -0.5*((double) numFloors)*((double) numTimeSteps)*log(2.*M_PI*sigmaSq) - 0.5*sum/sigmaSq; - return result; + return result; } diff --git a/examples/hysteretic/src/example_main.C b/examples/hysteretic/src/example_main.C index e7ce54231..ee5eaa787 100644 --- a/examples/hysteretic/src/example_main.C +++ b/examples/hysteretic/src/example_main.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * *-------------------------------------------------------------------------- *-------------------------------------------------------------------------- */ @@ -40,9 +40,9 @@ int main(int argc, char* argv[]) new QUESO::FullEnvironment(MPI_COMM_WORLD,argv[1],"",NULL); // Compute -#if 1 +#if 1 compute(*env); -#else +#else debug_hyst(*env); #endif diff --git a/examples/infoTheoryProblem/src/exInfoTheory_gsl.C b/examples/infoTheoryProblem/src/exInfoTheory_gsl.C index 50076a349..2326b6562 100644 --- a/examples/infoTheoryProblem/src/exInfoTheory_gsl.C +++ b/examples/infoTheoryProblem/src/exInfoTheory_gsl.C @@ -23,12 +23,12 @@ * *-------------------------------------------------------------------------- * - * Brief description of this file: - * + * Brief description of this file: + * * This is an example of how to use the information theoretic measures such as - * entropy, mutual information and Kullback-Leibler divergenece available in - * QUESO. The code itself is in the templated routine 'uqAppl(*env)'. This - * routine is called right after the initialization of the MPI environment and + * entropy, mutual information and Kullback-Leibler divergenece available in + * QUESO. The code itself is in the templated routine 'uqAppl(*env)'. This + * routine is called right after the initialization of the MPI environment and * of the QUESO environment and is available in file 'exInfoTheory_appl.h' * *-------------------------------------------------------------------------- diff --git a/examples/modal/src/example_compute.C b/examples/modal/src/example_compute.C index f0e7a07e6..7a82e26e1 100644 --- a/examples/modal/src/example_compute.C +++ b/examples/modal/src/example_compute.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * *-------------------------------------------------------------------------- *-------------------------------------------------------------------------- */ @@ -69,7 +69,7 @@ void compute(const QUESO::FullEnvironment& env, unsigned int numModes) { paramMaxsA[0] = 3.; paramMaxsA[1] = 3.; QUESO::BoxSubset - + paramDomainA("paramA_",paramSpaceA,paramMinsA,paramMaxsA); QUESO::GslVector paramMinsB(paramSpaceB.zeroVector()); @@ -98,7 +98,7 @@ void compute(const QUESO::FullEnvironment& env, unsigned int numModes) { // Step 3 of 5: Instantiate the likelihood function object //////////////////////////////////////////////////////// likelihoodRoutine_DataType likelihoodRoutine_Data; - + likelihoodRoutine_Data.numModes = numModes; QUESO::GenericScalarFunction likelihoodFunctionObj("like_", @@ -106,14 +106,14 @@ void compute(const QUESO::FullEnvironment& env, unsigned int numModes) { likelihoodRoutine, (void *) &likelihoodRoutine_Data, true); // routine computes [-2.*ln(function)] - + //////////////////////////////////////////////////////// // Step 4 of 5: Instantiate the inverse problem //////////////////////////////////////////////////////// #ifdef APPLS_MODAL_USES_CONCATENATION QUESO::UniformVectorRV priorRvA("priorA_", paramDomainA); - + QUESO::GslVector alpha(paramSpaceB.zeroVector()); alpha[0] = 3.; QUESO::GslVector beta(paramSpaceB.zeroVector()); diff --git a/examples/modal/src/example_likelihood.C b/examples/modal/src/example_likelihood.C index 35b56bb4d..10a3f990e 100644 --- a/examples/modal/src/example_likelihood.C +++ b/examples/modal/src/example_likelihood.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * *-------------------------------------------------------------------------- *-------------------------------------------------------------------------- */ @@ -55,7 +55,7 @@ double likelihoodRoutine( double sum1 = 0.; double sum2 = 0.; - double aux = (w1 - 72.0470); + double aux = (w1 - 72.0470); sum1 += aux*aux; aux = (w1 - 71.8995); sum1 += aux*aux; @@ -70,7 +70,7 @@ double likelihoodRoutine( // Ok, do nothing } else if (numModes == 2) { - aux = (w2 - 28.0292); + aux = (w2 - 28.0292); sum2 += aux*aux; aux = (w2 - 27.3726); sum2 += aux*aux; @@ -87,7 +87,7 @@ double likelihoodRoutine( "example_likelihood()", "invalid 'numModes'"); } - + double result = -0.5*((double) numModes)*5.*log(2.*M_PI*sigmaSq) - 0.5*(sum1+sum2)/sigmaSq; diff --git a/examples/modal/src/example_main.C b/examples/modal/src/example_main.C index 736826b61..62e7c19e4 100644 --- a/examples/modal/src/example_main.C +++ b/examples/modal/src/example_main.C @@ -25,8 +25,8 @@ * * $Id$ * - * Brief description of this file: - * + * Brief description of this file: + * * Usage: ./example_gsl example.inp <(int) numModes> *-------------------------------------------------------------------------- */ @@ -36,25 +36,25 @@ int main(int argc, char* argv[]) { // Initialize environment MPI_Init(&argc,&argv); - + UQ_FATAL_TEST_MACRO(argc != 3, QUESO::UQ_UNAVAILABLE_RANK, "main()", "after executable argv[0], input file must be specified in command line as argv[1], then numModes (1 or 2) must be specified as argv[2]"); - + QUESO::FullEnvironment* env = new QUESO::FullEnvironment(MPI_COMM_WORLD,argv[1],"",NULL); - + // Compute unsigned int numModes = (unsigned int) atoi(argv[2]); - + compute(*env,numModes); // Finalize environment delete env; MPI_Finalize(); - std::cout << std::endl << "FIM!" << std::endl << std::endl; - + std::cout << std::endl << "FIM!" << std::endl << std::endl; + return 0; } diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C index 739a703d8..534ec75b0 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_compute.C @@ -60,23 +60,23 @@ void compute(const QUESO::FullEnvironment& env) { (void *) &qoiRoutine_Data); // Step 5 of 6: Instantiate the forward problem - // Parameters are Gaussian RV - QUESO::GslVector meanVector( paramSpace.zeroVector() ); + // Parameters are Gaussian RV + QUESO::GslVector meanVector( paramSpace.zeroVector() ); meanVector[0] = -1; meanVector[1] = 2; - - QUESO::GslMatrix covMatrix = QUESO::GslMatrix(paramSpace.zeroVector()); - covMatrix(0,0) = 4.; - covMatrix(0,1) = 0.; - covMatrix(1,0) = 0.; - covMatrix(1,1) = 1.; - - QUESO::GaussianVectorRV + + QUESO::GslMatrix covMatrix = QUESO::GslMatrix(paramSpace.zeroVector()); + covMatrix(0,0) = 4.; + covMatrix(0,1) = 0.; + covMatrix(1,0) = 0.; + covMatrix(1,1) = 1.; + + QUESO::GaussianVectorRV paramRv("param_",paramDomain,meanVector,covMatrix); - + QUESO::GenericVectorRV qoiRv("qoi_", qoiSpace); - + QUESO::StatisticalForwardProblem fp("", NULL, paramRv, qoiFunctionObj, qoiRv); diff --git a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C index 6412a9187..7ffe70bbc 100644 --- a/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C +++ b/examples/simpleStatisticalForwardProblem/src/simple_sfp_example_qoi.C @@ -58,14 +58,14 @@ qoiRoutine( // Actual code // - // This code exemplifies multiple Monte Carlo solvers, each calling this qoi routine. - // In this simple example, only node 0 in each sub-environment does the job even though + // This code exemplifies multiple Monte Carlo solvers, each calling this qoi routine. + // In this simple example, only node 0 in each sub-environment does the job even though // there might be more than one node per sub-environment. // In a more realistic situation, if the user is asking for multiple nodes per sub- // environment, then the model code in the qoi routine might really demand more than one - // node. Here we use 'env.subRank()' only. A realistic application might want to use + // node. Here we use 'env.subRank()' only. A realistic application might want to use // either 'env.subComm()' or 'env.subComm().Comm()'. - + const QUESO::BaseEnvironment& env = paramValues.env(); if (env.subRank() == 0) { double coef1 = ((qoiRoutine_DataType *) functionDataPtr)->coef1; @@ -75,6 +75,6 @@ qoiRoutine( else { qoiValues[0] = 0.; } - + return; } diff --git a/examples/simpleStatisticalInverseProblem/src/example_compute.C b/examples/simpleStatisticalInverseProblem/src/example_compute.C index e66ba5a1b..0e1fa1d97 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_compute.C +++ b/examples/simpleStatisticalInverseProblem/src/example_compute.C @@ -46,15 +46,15 @@ void compute(const QUESO::FullEnvironment& env) { QUESO::GslVector meanVector(paramSpace.zeroVector()); meanVector[0] = -1; meanVector[1] = 2; - + QUESO::GslMatrix covMatrix(paramSpace.zeroVector()); covMatrix(0,0) = 4.; covMatrix(0,1) = 0.; covMatrix(1,0) = 0.; covMatrix(1,1) = 1.; - + likelihoodRoutine_DataType likelihoodRoutine_Data; likelihoodRoutine_Data.meanVector = &meanVector; likelihoodRoutine_Data.covMatrix = &covMatrix; - + QUESO::GenericScalarFunction likelihoodFunctionObj("like_", paramDomain, @@ -74,12 +74,12 @@ void compute(const QUESO::FullEnvironment& env) { QUESO::GslVector paramInitials(paramSpace.zeroVector()); paramInitials[0] = 0.1; paramInitials[1] = -1.4; - + QUESO::GslMatrix proposalCovMatrix(paramSpace.zeroVector()); proposalCovMatrix(0,0) = 8.; proposalCovMatrix(0,1) = 4.; proposalCovMatrix(1,0) = 4.; proposalCovMatrix(1,1) = 16.; - + ip.solveWithBayesMetropolisHastings(NULL,paramInitials, &proposalCovMatrix); - + return; } diff --git a/examples/simpleStatisticalInverseProblem/src/example_likelihood.C b/examples/simpleStatisticalInverseProblem/src/example_likelihood.C index 0f1e34360..146795d2e 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_likelihood.C +++ b/examples/simpleStatisticalInverseProblem/src/example_likelihood.C @@ -49,14 +49,14 @@ double likelihoodRoutine( // Actual code // - // This code exemplifies multiple Metropolis-Hastings solvers, each calling this likelihood - // routine. In this simple example, only node 0 in each subenvironment does the job even - // though there might be more than one node per sub-environment. In a more realistic - // situation, if the user is asking for multiple nodes per subenvironment, then the model - // code in the likelihood routines might really demand more than one node. Here we use + // This code exemplifies multiple Metropolis-Hastings solvers, each calling this likelihood + // routine. In this simple example, only node 0 in each subenvironment does the job even + // though there might be more than one node per sub-environment. In a more realistic + // situation, if the user is asking for multiple nodes per subenvironment, then the model + // code in the likelihood routines might really demand more than one node. Here we use // 'env.subRank()' only. A realistic application might want to use either 'env.subComm()' // or 'env.subComm().Comm()'. - + double result = 0.; const QUESO::BaseEnvironment& env = paramValues.env(); if (env.subRank() == 0) { diff --git a/examples/simpleStatisticalInverseProblem/src/example_main.C b/examples/simpleStatisticalInverseProblem/src/example_main.C index 6640b53b1..4eddb1098 100644 --- a/examples/simpleStatisticalInverseProblem/src/example_main.C +++ b/examples/simpleStatisticalInverseProblem/src/example_main.C @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) QUESO::UQ_UNAVAILABLE_RANK, "main()", "input file must be specified in command line as argv[1], just after executable argv[0]"); - + QUESO::FullEnvironment* env = new QUESO::FullEnvironment(MPI_COMM_WORLD,argv[1],"",NULL); // Compute diff --git a/examples/statisticalForwardProblem/src/exStatisticalForwardProblem_gsl.C b/examples/statisticalForwardProblem/src/exStatisticalForwardProblem_gsl.C index b50f0cccf..d5b81cbd9 100644 --- a/examples/statisticalForwardProblem/src/exStatisticalForwardProblem_gsl.C +++ b/examples/statisticalForwardProblem/src/exStatisticalForwardProblem_gsl.C @@ -23,9 +23,9 @@ * *-------------------------------------------------------------------------- * - * Brief description of this file: - * - * This is an example of how to define and solve a statistical forward problem + * Brief description of this file: + * + * This is an example of how to define and solve a statistical forward problem * using QUESO classes and algorithms. The code itself is in the templated * routine 'uqAppl(*env)'. This routine is called right after the initialization * of the MPI environment and of the QUESO environment and is available in diff --git a/examples/statisticalInverseProblem/src/exStatisticalInverseProblem_gsl.C b/examples/statisticalInverseProblem/src/exStatisticalInverseProblem_gsl.C index 3ac3d0f5d..806e8d8b5 100644 --- a/examples/statisticalInverseProblem/src/exStatisticalInverseProblem_gsl.C +++ b/examples/statisticalInverseProblem/src/exStatisticalInverseProblem_gsl.C @@ -23,9 +23,9 @@ * *-------------------------------------------------------------------------- * - * Brief description of this file: - * - * This is an example of how to define and solve a statistical inverse problem + * Brief description of this file: + * + * This is an example of how to define and solve a statistical inverse problem * using QUESO classes and algorithms. The code itself is in the templated * routine 'uqAppl(*env)'. This routine is called right after the initialization * of the MPI environment and of the QUESO environment and is available in diff --git a/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_gsl.C b/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_gsl.C index 780aade57..9a5134029 100644 --- a/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_gsl.C +++ b/examples/statisticalInverse_Fortran/src/exStatisticalInverseProblem1_gsl.C @@ -23,9 +23,9 @@ * *-------------------------------------------------------------------------- * - * Brief description of this file: - * - * This is an example of how to define and solve a statistical inverse problem + * Brief description of this file: + * + * This is an example of how to define and solve a statistical inverse problem * using QUESO classes and algorithms. The code itself is in the templated * routine 'uqAppl(*env)'. This routine is called right after the initialization * of the MPI environment and of the QUESO environment and is available in diff --git a/examples/validationCycle/originalData/global.c b/examples/validationCycle/originalData/global.c index ddc51ebda..4329d8848 100644 --- a/examples/validationCycle/originalData/global.c +++ b/examples/validationCycle/originalData/global.c @@ -32,25 +32,25 @@ int jac(double t, const double M[], double *dfdM, double dfdt, void *info) double A = params[0],E = params[1],beta = params[2]; dfdM = -A*exp(-E/(R*t))/beta; dfdt = -A*M[0]*E*exp(-E/(R*t))/(beta*R*t*t); - return GSL_SUCCESS; + return GSL_SUCCESS; } #endif int main() { - + double E2=0.; double A,E,beta,te[11],Me[11],Mt[11]; int num_data; FILE *inp, *outp; - + inp = fopen("global.dat","r"); fscanf(inp,"%lf %lf %lf",&A,&E,&beta); /* read kinetic parameters */ - + beta/=60.; /* Convert heating rate to K/s */ - + double params[]={A,E,beta}; - + // read experimental data int i=0; int status; @@ -61,47 +61,47 @@ int main() } num_data = i; fclose(inp); - + // integration const gsl_odeiv_step_type * T = gsl_odeiv_step_gear1; - + gsl_odeiv_step *s = gsl_odeiv_step_alloc(T,1); gsl_odeiv_control *c = gsl_odeiv_control_y_new(1e-6,0.0); gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc(1); - - gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; - + + gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; + double t = 0.1, t1 = 800.; double h = 1e-3; double M[1]; M[0]=1.; - + outp = fopen("global.out","w"); fprintf(outp,"Temp (K) M\n------------------\n"); i=0; double t_old=0., M_old[1]; M_old[0]=1.; - + while (t < t1){ int status = gsl_odeiv_evolve_apply(e, c, s, &sys, &t, t1, &h, M); - + if (status != GSL_SUCCESS) break; - + fprintf(outp,"%6.1lf %10.4lf\n",t,M[0]); - + if ( (t >= te[i]) && (t_old <= te[i]) ) { Mt[i] = (te[i]-t_old)*(M[0]-M_old[0])/(t-t_old) + M_old[0]; E2+=(Me[i]-Mt[i])*(Me[i]-Mt[i]); // fprintf(outp,"%i %lf %lf %lf %lf\n",i,te[i],Me[i],Mt[i],E2); i++; } - + t_old=t; M_old[0]=M[0]; - + } - + fprintf(outp,"For A = %g, E = %g, and beta = %.3lf\n",A,E,beta); fprintf(outp,"the sum of squared errors is %lf.",E2); @@ -110,7 +110,7 @@ int main() gsl_odeiv_step_free(s); fclose(outp); - + return 0; - + } diff --git a/examples/validationCycle2/src/tga2_appl.C b/examples/validationCycle2/src/tga2_appl.C index dff750d23..cc5187a22 100644 --- a/examples/validationCycle2/src/tga2_appl.C +++ b/examples/validationCycle2/src/tga2_appl.C @@ -245,7 +245,7 @@ uqAppl(const QUESO::BaseEnvironment& env) //******************************************************** // The 'local comparison stage' of the driving routine "uqAppl()" //******************************************************** -void +void uqAppl_LocalComparisonStage(QUESO::ValidationCycle& cycle) { if (cycle.calFP().computeSolutionFlag() && @@ -333,7 +333,7 @@ uqAppl_LocalComparisonStage(QUESO::ValidationCycle& cycle) { if (cycle.calFP().computeSolutionFlag() && diff --git a/examples/validationCycle2/src/tga2_likelihood.C b/examples/validationCycle2/src/tga2_likelihood.C index cd26fd364..32aa1ac29 100644 --- a/examples/validationCycle2/src/tga2_likelihood.C +++ b/examples/validationCycle2/src/tga2_likelihood.C @@ -61,7 +61,7 @@ likelihoodRoutine_Data::likelihoodRoutine_Data( // Read kinetic parameters and convert heating rate to K/s int aux1 = fscanf(inp,"%lf %lf",&m_beta1,&m_variance1); m_beta1 /= 60.; - + if(aux1) {}; // just to eliminate warnings unsigned int numObservations = 0; @@ -97,7 +97,7 @@ likelihoodRoutine_Data::likelihoodRoutine_Data( // Read kinetic parameters and convert heating rate to K/s int aux2 = fscanf(inp,"%lf %lf",&m_beta2,&m_variance2); m_beta2 /= 60.; - + if(aux2) {}; // just to eliminate warnings unsigned int numObservations = 0; @@ -133,7 +133,7 @@ likelihoodRoutine_Data::likelihoodRoutine_Data( // Read kinetic parameters and convert heating rate to K/s int aux3 = fscanf(inp,"%lf %lf",&m_beta3,&m_variance3); m_beta3 /= 60.; - + if(aux3) {}; // just to eliminate warnings unsigned int numObservations = 0; @@ -179,7 +179,7 @@ likelihoodRoutine( const QUESO::BaseEnvironment& env = *(((likelihoodRoutine_Data*) functionDataPtr)->m_env); if (paramDirection && - functionDataPtr && + functionDataPtr && gradVector && hessianMatrix && hessianEffect) { @@ -201,24 +201,24 @@ likelihoodRoutine( std::vector Mt(Me.size(),0.); double params[]={A,E,beta}; - + // integration const gsl_odeiv_step_type *T = gsl_odeiv_step_rkf45; //rkf45; //gear1; gsl_odeiv_step *s = gsl_odeiv_step_alloc(T,1); gsl_odeiv_control *c = gsl_odeiv_control_y_new(1e-6,0.0); gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc(1); - gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; + gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; double t = 0.1, t_final = 1900.; double h = 1e-3; double Mass[1]; Mass[0]=1.; - + unsigned int i = 0; double t_old = 0.; double M_old[1]; M_old[0]=1.; - + double misfit=0.; //unsigned int loopSize = 0; while ((t < t_final) && (i < Me.size())) { @@ -229,19 +229,19 @@ likelihoodRoutine( "gsl_odeiv_evolve_apply() failed"); //printf("t = %6.1lf, mass = %10.4lf\n",t,Mass[0]); //loopSize++; - + while ( (i < Me.size()) && (t_old <= Te[i]) && (Te[i] <= t) ) { Mt[i] = (Te[i]-t_old)*(Mass[0]-M_old[0])/(t-t_old) + M_old[0]; misfit += (Me[i]-Mt[i])*(Me[i]-Mt[i]); //printf("%i %lf %lf %lf %lf\n",i,Te[i],Me[i],Mt[i],misfit); i++; } - + t_old=t; M_old[0]=Mass[0]; } resultValue += misfit/variance; - + //printf("loopSize = %d\n",loopSize); if ((paramValues.env().displayVerbosity() >= 10) && (paramValues.env().fullRank() == 0)) { printf("In likelihoodRoutine(), A = %g, E = %g, beta = %.3lf: misfit = %lf, likelihood = %lf.\n",A,E,beta,misfit,resultValue); @@ -264,24 +264,24 @@ likelihoodRoutine( std::vector Mt(Me.size(),0.); double params[]={A,E,beta}; - + // integration const gsl_odeiv_step_type *T = gsl_odeiv_step_rkf45; //rkf45; //gear1; gsl_odeiv_step *s = gsl_odeiv_step_alloc(T,1); gsl_odeiv_control *c = gsl_odeiv_control_y_new(1e-6,0.0); gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc(1); - gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; + gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; double t = 0.1, t_final = 1900.; double h = 1e-3; double Mass[1]; Mass[0]=1.; - + unsigned int i = 0; double t_old = 0.; double M_old[1]; M_old[0]=1.; - + double misfit=0.; //unsigned int loopSize = 0; while ((t < t_final) && (i < Me.size())) { @@ -292,19 +292,19 @@ likelihoodRoutine( "gsl_odeiv_evolve_apply() failed"); //printf("t = %6.1lf, mass = %10.4lf\n",t,Mass[0]); //loopSize++; - + while ( (i < Me.size()) && (t_old <= Te[i]) && (Te[i] <= t) ) { Mt[i] = (Te[i]-t_old)*(Mass[0]-M_old[0])/(t-t_old) + M_old[0]; misfit += (Me[i]-Mt[i])*(Me[i]-Mt[i]); //printf("%i %lf %lf %lf %lf\n",i,Te[i],Me[i],Mt[i],misfit); i++; } - + t_old=t; M_old[0]=Mass[0]; } resultValue += misfit/variance; - + //printf("loopSize = %d\n",loopSize); if ((paramValues.env().displayVerbosity() >= 10) && (paramValues.env().fullRank() == 0)) { printf("In likelihoodRoutine(), A = %g, E = %g, beta = %.3lf: misfit = %lf, likelihood = %lf.\n",A,E,beta,misfit,resultValue); @@ -327,24 +327,24 @@ likelihoodRoutine( std::vector Mt(Me.size(),0.); double params[]={A,E,beta}; - + // integration const gsl_odeiv_step_type *T = gsl_odeiv_step_rkf45; //rkf45; //gear1; gsl_odeiv_step *s = gsl_odeiv_step_alloc(T,1); gsl_odeiv_control *c = gsl_odeiv_control_y_new(1e-6,0.0); gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc(1); - gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; + gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; double t = 0.1, t_final = 1900.; double h = 1e-3; double Mass[1]; Mass[0]=1.; - + unsigned int i = 0; double t_old = 0.; double M_old[1]; M_old[0]=1.; - + double misfit=0.; //unsigned int loopSize = 0; while ((t < t_final) && (i < Me.size())) { @@ -355,19 +355,19 @@ likelihoodRoutine( "gsl_odeiv_evolve_apply() failed"); //printf("t = %6.1lf, mass = %10.4lf\n",t,Mass[0]); //loopSize++; - + while ( (i < Me.size()) && (t_old <= Te[i]) && (Te[i] <= t) ) { Mt[i] = (Te[i]-t_old)*(Mass[0]-M_old[0])/(t-t_old) + M_old[0]; misfit += (Me[i]-Mt[i])*(Me[i]-Mt[i]); //printf("%i %lf %lf %lf %lf\n",i,Te[i],Me[i],Mt[i],misfit); i++; } - + t_old=t; M_old[0]=Mass[0]; } resultValue += misfit/variance; - + //printf("loopSize = %d\n",loopSize); if ((paramValues.env().displayVerbosity() >= 10) && (paramValues.env().fullRank() == 0)) { printf("In likelihoodRoutine(), A = %g, E = %g, beta = %.3lf: misfit = %lf, likelihood = %lf.\n",A,E,beta,misfit,resultValue); diff --git a/examples/validationCycle2/src/tga2_qoi.C b/examples/validationCycle2/src/tga2_qoi.C index 835553466..6c03fc496 100644 --- a/examples/validationCycle2/src/tga2_qoi.C +++ b/examples/validationCycle2/src/tga2_qoi.C @@ -38,7 +38,7 @@ void qoiRoutine(const QUESO::GslVector& paramValues, QUESO::DistArray* hessianEffects) { if (paramDirection && - functionDataPtr && + functionDataPtr && gradVectors && hessianMatrices && hessianEffects) { @@ -52,23 +52,23 @@ void qoiRoutine(const QUESO::GslVector& paramValues, double criticalTime = ((qoiRoutine_Data *) functionDataPtr)->m_criticalTime; double params[]={A,E,beta}; - + // integration const gsl_odeiv_step_type *T = gsl_odeiv_step_rkf45; //rkf45; //gear1; gsl_odeiv_step *s = gsl_odeiv_step_alloc(T,1); gsl_odeiv_control *c = gsl_odeiv_control_y_new(1e-6,0.0); gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc(1); - gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; - + gsl_odeiv_system sys = {func, NULL, 1, (void *)params}; + double temperature = 0.1; double h = 1e-3; double Mass[1]; Mass[0]=1.; - + double temperature_old = 0.; double M_old[1]; M_old[0]=1.; - + double crossingTemperature = 0.; //unsigned int loopSize = 0; while ((temperature < criticalTime*beta) && @@ -84,14 +84,14 @@ void qoiRoutine(const QUESO::GslVector& paramValues, if (Mass[0] <= criticalMass) { crossingTemperature = temperature_old + (temperature - temperature_old) * (M_old[0]-criticalMass)/(M_old[0]-Mass[0]); } - + temperature_old=temperature; M_old[0]=Mass[0]; } if (criticalMass > 0.) qoiValues[0] = crossingTemperature/beta; // QoI = time to achieve critical mass if (criticalTime > 0.) qoiValues[0] = Mass[0]; // QoI = mass fraction remaining at critical time - + //printf("loopSize = %d\n",loopSize); if ((paramValues.env().displayVerbosity() >= 3) && (paramValues.env().fullRank() == 0)) { printf("In qoiRoutine(), A = %g, E = %g, beta = %.3lf, criticalTime = %.3lf, criticalMass = %.3lf: qoi = %lf.\n",A,E,beta,criticalTime,criticalMass,qoiValues[0]); diff --git a/src/basic/inc/ArrayOfSequences.h b/src/basic/inc/ArrayOfSequences.h index d881c07ad..2ff938d89 100644 --- a/src/basic/inc/ArrayOfSequences.h +++ b/src/basic/inc/ArrayOfSequences.h @@ -31,13 +31,13 @@ namespace QUESO { /*! \file uqArrayOfSequences.h * \brief A templated class for handling samples of scalar sequences - * + * * \class ArrayOfSequences * \brief Class for handling array samples (arrays of scalar sequences). * - * This class handles array of sequences (samples) generated by an algorithm, - * as well as operations that can be carried over them, e.g., calculation of - * means, correlation and covariance matrices. It is derived from and implements + * This class handles array of sequences (samples) generated by an algorithm, + * as well as operations that can be carried over them, e.g., calculation of + * means, correlation and covariance matrices. It is derived from and implements * BaseVectorSequence.*/ template @@ -45,7 +45,7 @@ class ArrayOfSequences : public BaseVectorSequence { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. ArrayOfSequences(const VectorSpace& vectorSpace, unsigned int subSequenceSize, @@ -55,10 +55,10 @@ class ArrayOfSequences : public BaseVectorSequence //@} //! @name Sequence methods - //@{ + //@{ //! Size of the sub-sequence of arrays. unsigned int subSequenceSize () const; - + //! Resizes the sequence. void resizeSequence (unsigned int newSubSequenceSize); @@ -66,40 +66,40 @@ class ArrayOfSequences : public BaseVectorSequence /*! This routine deletes all stored computed vectors */ void resetValues (unsigned int initialPos, unsigned int numPos); - //! Erases \c numPos elements of the sequence starting at position \c initialPos. + //! Erases \c numPos elements of the sequence starting at position \c initialPos. /*! This routine deletes all stored computed vectors */ void erasePositions (unsigned int initialPos, unsigned int numPos); - + //! Gets the values of the sequence at position \c posId and stores them at \c vec. void getPositionValues (unsigned int posId, V& vec) const; - - //! Set the values of \c vec at position \c posId of the sequence. + + //! Set the values of \c vec at position \c posId of the sequence. /*! This routine deletes all stored computed vectors */ void setPositionValues (unsigned int posId, const V& vec); - + //! Sets the values of the sequence as a Gaussian distribution of mean given by \c meanVec and standard deviation by \c stdDevVec. /*! This routine deletes all stored computed vectors */ void setGaussian (const V& meanVec, const V& stdDevVec); - + //! Sets the values of the sequence as a uniform distribution between the values given by vectors \c aVec and \c bVec. /*! This routine deletes all stored computed vectors */ void setUniform (const V& aVec, const V& bVec ); - + //! Finds the mean value of the sub-sequence, considering \c numPos positions starting at position \c initialPos. void mean (unsigned int initialPos, unsigned int numPos, V& meanVec) const; //! Finds the mean value of the unified sequence of \c numPos positions starting at position \c initialPos. See template specialization. - // TODO not implemented. + // TODO not implemented. void unifiedMean (unsigned int initialPos, unsigned int numPos, V& unifiedMeanVec) const; - //! Finds the sample variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. + //! Finds the sample variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. void sampleVariance (unsigned int initialPos, unsigned int numPos, const V& meanVec, V& samVec) const; - //! Finds the sample variance of the unified sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. + //! Finds the sample variance of the unified sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. // TODO not implemented. void unifiedSampleVariance(unsigned int initialPos, unsigned int numPos, @@ -110,9 +110,9 @@ class ArrayOfSequences : public BaseVectorSequence unsigned int numPos, const V& meanVec, V& popVec) const; - //! Calculates the autocovariance. - /*! The autocovariance is the covariance of a variable with itself at some other time. It is - * calculated over a sequence of arrays with initial position \c initialPos, considering + //! Calculates the autocovariance. + /*! The autocovariance is the covariance of a variable with itself at some other time. It is + * calculated over a sequence of arrays with initial position \c initialPos, considering * \c numPos positions, a lag of \c lag, with mean given by \c meanVec. The results are saved * in the output vector \c covVec/ */ void autoCovariance (unsigned int initialPos, @@ -121,19 +121,19 @@ class ArrayOfSequences : public BaseVectorSequence unsigned int lag, V& covVec) const; - //! Calculates autocorrelation via definition. + //! Calculates autocorrelation via definition. void autoCorrViaDef (unsigned int initialPos, unsigned int numPos, unsigned int lag, V& corrVec) const; - //! Calculates autocorrelation via Fast Fourier transforms (FFT). + //! Calculates autocorrelation via Fast Fourier transforms (FFT). //! TODO: Implement me! void autoCorrViaFft (unsigned int initialPos, unsigned int numPos, const std::vector& lags, std::vector& corrVecs) const; - //! Calculates autocorrelation via Fast Fourier transforms (FFT). + //! Calculates autocorrelation via Fast Fourier transforms (FFT). //! TODO: Implement me! void autoCorrViaFft (unsigned int initialPos, unsigned int numPos, @@ -150,12 +150,12 @@ class ArrayOfSequences : public BaseVectorSequence const V& maxVec, std::vector& centersForAllBins, std::vector& quanttsForAllBins) const; - + //! Returns the interquartile range of the values in the sequence. /*! TODO: implement me! */ void interQuantileRange (unsigned int initialPos, V& iqrs) const; - + //! Selects the scales (bandwidth, \c scaleVec) for the kernel density estimation, of the sequence. /*! TODO: implement me! */ void scalesForKDE (unsigned int initialPos, @@ -167,7 +167,7 @@ class ArrayOfSequences : public BaseVectorSequence void gaussianKDE (const V& evaluationParamVec, V& densityVec) const; //! TODO: Gaussian kernel for the KDE of the sequence. - /*! \todo: implement me! + /*! \todo: implement me! * The density estimator will be: * \f[ \hat{f}(x) = \frac{1}{nh} \sum_{j=1}^n K\Big(\frac{x-x_j}{h}\Big),\f] * where \f$ K \f$ is a Gaussian kernel. */ @@ -177,33 +177,33 @@ class ArrayOfSequences : public BaseVectorSequence std::vector& densityVecs) const; //! Write contents of the chain to a file. void writeContents (std::ofstream& ofsvar) const; - + //! Writes info of the unified sequence to a file. /*! TODO: implement me! */ void unifiedWriteContents (std::ofstream& ofsvar) const; - + //! Writes info of the unified sequence to a file. /*! TODO: implement me! */ void unifiedWriteContents (const std::string& fileName, const std::string& fileType) const; - + //! Reads the unified sequence from a file. /*! TODO: implement me! */ void unifiedReadContents (const std::string& fileName, const std::string& fileType, const unsigned int subSequenceSize); - - //! Select positions in the sequence of vectors. + + //! Select positions in the sequence of vectors. /*! TODO: implement me! */ void select (const std::vector& idsOfUniquePositions); - + //! Filters positions in the sequence of vectors, starting at \c initialPos, and with spacing given by \c spacing. /*! TODO: implement me! */ void filter (unsigned int initialPos, unsigned int spacing); - //! Extracts a sequence of scalars of size \c numPos, from position \c paramId of the array of sequences. - /*! In this method, the parameter \c initialPos is unused and the parameter \c spacing is always equal + //! Extracts a sequence of scalars of size \c numPos, from position \c paramId of the array of sequences. + /*! In this method, the parameter \c initialPos is unused and the parameter \c spacing is always equal * to one */ void extractScalarSeq (unsigned int initialPos, unsigned int spacing, @@ -216,7 +216,7 @@ class ArrayOfSequences : public BaseVectorSequence ArrayOfOneDGrids & mdfGrids, ArrayOfOneDTables& mdfValues) const; #endif - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS void uniformlySampledCdf (const V& numEvaluationPointsVec, ArrayOfOneDGrids & cdfGrids, @@ -229,7 +229,7 @@ class ArrayOfSequences : public BaseVectorSequence unsigned int paramId, std::vector >& resultData) const; //void fftInverse (unsigned int fftSize); - + void psd (unsigned int initialPos, unsigned int numBlocks, double hopSizeRatio, @@ -245,10 +245,10 @@ class ArrayOfSequences : public BaseVectorSequence V& gewVec) const; #endif //@} - + private: //! Extracts the raw data. - /*! Extracts the data from sequence of array at position \c paramId, with spacing \c spacing, + /*! Extracts the data from sequence of array at position \c paramId, with spacing \c spacing, * and saves is in \c rawData. The vector \c rawData will have size \c numPos. Note that, in * fact, \c spacing = 1. */ void extractRawData (unsigned int initialPos, diff --git a/src/basic/inc/BoxSubset.h b/src/basic/inc/BoxSubset.h index 9678182d7..bf2dea380 100644 --- a/src/basic/inc/BoxSubset.h +++ b/src/basic/inc/BoxSubset.h @@ -43,8 +43,8 @@ class BoxSubset : public VectorSubset { //! @name Constructor/Destructor methods //@{ - //! Shaped, default constructor. - /*! Construct a subspace of \c vectorSpace, with min and max values given by the vectors \c minValues + //! Shaped, default constructor. + /*! Construct a subspace of \c vectorSpace, with min and max values given by the vectors \c minValues * and \c maxValues, respectively. It checks for possible inconsistencies between the values stored in * \c minValues and \c maxValues, and calculates the volume of the box subset, assigning it to m_volume. */ BoxSubset(const char* prefix, @@ -57,19 +57,19 @@ class BoxSubset : public VectorSubset { //@} //! @name Mathematical methods. - //@{ - //! Checks whether this box subset contains vector \c vec. - /*! It checks if both statements are true: 1) all components in \c vec are larger than + //@{ + //! Checks whether this box subset contains vector \c vec. + /*! It checks if both statements are true: 1) all components in \c vec are larger than * m_minValues, and 2) all all components in \c vec are smaller than m_maxValues. */ bool contains (const V& vec) const; - - //! Vector of the minimum values of the box subset. + + //! Vector of the minimum values of the box subset. const V& minValues() const; - - //! Vector of the maximum values of the box subset. + + //! Vector of the maximum values of the box subset. const V& maxValues() const; //@} - + //! Prints the volume, the minimum and the maximum values of \c this. void print (std::ostream& os) const; @@ -78,10 +78,10 @@ class BoxSubset : public VectorSubset { using VectorSet ::m_prefix; using VectorSet ::m_volume; using VectorSubset::m_vectorSpace; - + //! Vector of templated type \c V to store the minimum values of the box subset class. V m_minValues; - + //! Vector of templated type \c V to store the maximum values of the box subset class. V m_maxValues; }; diff --git a/src/basic/inc/ConcatenationSubset.h b/src/basic/inc/ConcatenationSubset.h index ace38fb49..ad523e645 100644 --- a/src/basic/inc/ConcatenationSubset.h +++ b/src/basic/inc/ConcatenationSubset.h @@ -40,7 +40,7 @@ template class ConcatenationSubset : public VectorSubset { public: //! @name Constructor/Destructor methods. - //@{ + //@{ //! Constructor - two sets only /*! It concatenates set1 and set2 into a new set, m_set, of volume given by * set1.volume()*set2.volume(). */ @@ -48,7 +48,7 @@ class ConcatenationSubset : public VectorSubset { const VectorSpace& vectorSpace, const VectorSet& set1, const VectorSet& set2); - + //! Constructor - collection of sets /*! It concatenates a collection of n subsets (using the std::vector to represent such collection) * into a new set, m_set, of volume given by sets[0].volume()*sets[1].volume()*...*sets[n-1].volume(). */ @@ -59,15 +59,15 @@ class ConcatenationSubset : public VectorSubset { //! Destructor ~ConcatenationSubset(); //@} - + //! @name Mathematical methods. - //@{ + //@{ //! Determines whether each one of the subsets m_sets (class' private attributes) contains vector \c vec. bool contains(const V& vec) const; //@} - + //! @name I/O methods. - //@{ + //@{ //! Prints the subsets (via protected attribute m_sets). void print (std::ostream& os) const; //@} diff --git a/src/basic/inc/ConstantScalarFunction.h b/src/basic/inc/ConstantScalarFunction.h index 03eec5827..5127b3663 100644 --- a/src/basic/inc/ConstantScalarFunction.h +++ b/src/basic/inc/ConstantScalarFunction.h @@ -36,14 +36,14 @@ namespace QUESO { /*!\class ConstantScalarFunction * \brief A class for handling scalar functions which image is a constant (real number). * - * This class allows the mathematical definition of a scalar function which image set + * This class allows the mathematical definition of a scalar function which image set * is a constant (real number). */ template class ConstantScalarFunction : public BaseScalarFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Instantiates an object of the class, i.e. a scalar function, given a prefix, its domain and constant-valued image.*/ ConstantScalarFunction(const char* prefix, @@ -53,10 +53,10 @@ class ConstantScalarFunction : public BaseScalarFunction { virtual ~ConstantScalarFunction(); //! @name Mathematical method - //@{ + //@{ //! Calculates the actual value of this scalar function. double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Calculates the logarithm of the value of this scalar function (which is zero). double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; //@} diff --git a/src/basic/inc/ConstantVectorFunction.h b/src/basic/inc/ConstantVectorFunction.h index 820719d4d..525ae87f8 100644 --- a/src/basic/inc/ConstantVectorFunction.h +++ b/src/basic/inc/ConstantVectorFunction.h @@ -39,14 +39,14 @@ namespace QUESO { /*!\class ConstantVectorFunction * \brief A class for handling vector functions which image is constant. * - * This class allows the mathematical definition of a vector-valued function which image + * This class allows the mathematical definition of a vector-valued function which image * set is constant vector. */ template class ConstantVectorFunction : public BaseVectorFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor /*! Instantiates an object of the class, i.e. a vector function, given a prefix, its domain and constant image.*/ ConstantVectorFunction(const char* prefix, @@ -56,10 +56,10 @@ class ConstantVectorFunction : public BaseVectorFunction { //! Destructor virtual ~ConstantVectorFunction(); //@} - + //! @name Mathematical method - //@{ - //! Calculates the image vector: assigns to the protected attribute \c m_constantImageVector the value of the constant vector \c imageVector. + //@{ + //! Calculates the image vector: assigns to the protected attribute \c m_constantImageVector the value of the constant vector \c imageVector. void compute (const P_V& domainVector, const P_V* domainDirection, Q_V& imageVector, diff --git a/src/basic/inc/DiscreteSubset.h b/src/basic/inc/DiscreteSubset.h index de9351a68..28431eee0 100644 --- a/src/basic/inc/DiscreteSubset.h +++ b/src/basic/inc/DiscreteSubset.h @@ -33,8 +33,8 @@ namespace QUESO { /*! \class DiscreteSubset * \brief A templated class representing the discrete vector subsets. * - * This class is used to represent the a discrete vector subset. Here the - * notion of volume does not apply, instead there is the total number of + * This class is used to represent the a discrete vector subset. Here the + * notion of volume does not apply, instead there is the total number of * elements (vectors) that belongs to the subset. */ @@ -42,7 +42,7 @@ template class DiscreteSubset : public VectorSubset { public: //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default Constructor /*! It constructs a class object given the prefix, vector space to which it * belongs and its number of elements.*/ @@ -52,16 +52,16 @@ class DiscreteSubset : public VectorSubset { //! Destructor ~DiscreteSubset(); //@} - + //! @name Mathematical methods. - //@{ + //@{ //! Checks whether this discrete subset contains vector \c vec. TODO: incomplete code. bool contains (const V& vec) const; //@} - + //! @name I/O methods. - //@{ - //! Prints nothing. + //@{ + //! Prints nothing. void print (std::ostream& os) const; //@} protected: @@ -69,7 +69,7 @@ class DiscreteSubset : public VectorSubset { using VectorSet ::m_prefix; using VectorSet ::m_volume; using VectorSubset::m_vectorSpace; - + //! Number of elements in the discrete vector subset. std::vector m_elements; }; diff --git a/src/basic/inc/GenericScalarFunction.h b/src/basic/inc/GenericScalarFunction.h index 9f3bd0c23..5acbd370c 100644 --- a/src/basic/inc/GenericScalarFunction.h +++ b/src/basic/inc/GenericScalarFunction.h @@ -44,9 +44,9 @@ class GenericScalarFunction : public BaseScalarFunction { public: //! @name Constructor/Destructor methods //@{ - //! Default constructor. - /*! Instantiates an object of \c this class given its prefix, domain set and a pointer to a routine. - This routine plays the role of a scalar math function, and it is useful, for instance, to calculate + //! Default constructor. + /*! Instantiates an object of \c this class given its prefix, domain set and a pointer to a routine. + This routine plays the role of a scalar math function, and it is useful, for instance, to calculate the likelihood (and its image set).*/ GenericScalarFunction(const char* prefix, const VectorSet& domainSet, @@ -57,10 +57,10 @@ class GenericScalarFunction : public BaseScalarFunction { virtual ~GenericScalarFunction(); //! @name Mathematical method - //@{ + //@{ //! Calculates the actual value of this scalar function. double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Calculates the logarithm of value of this scalar function. /*! It is used in routines that calculate the likelihood and expect the logarithm of value.*/ double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; @@ -72,8 +72,8 @@ class GenericScalarFunction : public BaseScalarFunction { //! Routine defining a scalar function. /*! The presence of the parameters \c gradVectors, \c hessianMatrices and \c hessianEffects - * allows the user to calculate gradient vectors, Hessian matrices and Hessian effects; which - * can hold important information about her/his statistical application. Used, for instance to + * allows the user to calculate gradient vectors, Hessian matrices and Hessian effects; which + * can hold important information about her/his statistical application. Used, for instance to * define the likelihood. */ double (*m_valueRoutinePtr)(const V& domainVector, const V* domainDirection, const void* routinesDataPtr, V* gradVector, M* hessianMatrix, V* hessianEffect); const void* m_routinesDataPtr; diff --git a/src/basic/inc/GenericVectorFunction.h b/src/basic/inc/GenericVectorFunction.h index 4019a0d54..59ec3cfe6 100644 --- a/src/basic/inc/GenericVectorFunction.h +++ b/src/basic/inc/GenericVectorFunction.h @@ -40,7 +40,7 @@ namespace QUESO { * \brief A class for handling generic vector functions. * * This class allows the mathematical definition of a vector function such as: - * \f$ \mathbf{q}: B \subset R^n \rightarrow R^m \f$. It is derived from + * \f$ \mathbf{q}: B \subset R^n \rightarrow R^m \f$. It is derived from * BaseVectorFunction. */ @@ -50,9 +50,9 @@ class GenericVectorFunction : public BaseVectorFunction { //! @name Constructor/Destructor methods //@{ - //! Default constructor. - /*! Instantiates an object of \c this class given its prefix, domain and a pointer to a routine. - This routine plays the role of a vector-valued function, and it is useful, for instance, to + //! Default constructor. + /*! Instantiates an object of \c this class given its prefix, domain and a pointer to a routine. + This routine plays the role of a vector-valued function, and it is useful, for instance, to calculate the likelihood (and its image set).*/ GenericVectorFunction(const char* prefix, const VectorSet& domainSet, @@ -68,10 +68,10 @@ class GenericVectorFunction : public BaseVectorFunction { //! Virtual destructor. virtual ~GenericVectorFunction(); - + //! @name Mathematical method - //@{ - //! Calls the protected member \c *m_routinePtr(), in order to calculate the image vector \c imageVector. + //@{ + //! Calls the protected member \c *m_routinePtr(), in order to calculate the image vector \c imageVector. void compute (const P_V& domainVector, const P_V* domainDirection, Q_V& imageVector, @@ -79,12 +79,12 @@ class GenericVectorFunction : public BaseVectorFunction { DistArray* hessianMatrices, // Yes, 'P_M' DistArray* hessianEffects) const; //@} - + protected: //! Routine defining a vector-valued function. /*! The presence of the parameters \c gradVectors, \c hessianMatrices and \c hessianEffects - * allows the user to calculate gradient vectors, Hessian matrices and Hessian effects; which - * can hold important information about her/his statistical application. Used, for instance to + * allows the user to calculate gradient vectors, Hessian matrices and Hessian effects; which + * can hold important information about her/his statistical application. Used, for instance to * define the likelihood. */ void (*m_routinePtr)(const P_V& domainVector, const P_V* domainDirection, diff --git a/src/basic/inc/InstantiateIntersection.h b/src/basic/inc/InstantiateIntersection.h index 20153dc6d..d887ce565 100644 --- a/src/basic/inc/InstantiateIntersection.h +++ b/src/basic/inc/InstantiateIntersection.h @@ -34,7 +34,7 @@ namespace QUESO { */ //! This method calculates the intersection of \c domain1 and \c domain2. -/*! It is used, for instance, to calculate the domain of the Posterior PDF, which is +/*! It is used, for instance, to calculate the domain of the Posterior PDF, which is * the intersection of the domain of the Prior PDF and of the likelihood function.*/ template VectorSet* InstantiateIntersection(const VectorSet& domain1, diff --git a/src/basic/inc/IntersectionSubset.h b/src/basic/inc/IntersectionSubset.h index e9e104df6..d8b3fe8b4 100644 --- a/src/basic/inc/IntersectionSubset.h +++ b/src/basic/inc/IntersectionSubset.h @@ -34,15 +34,15 @@ namespace QUESO { * \brief A templated class representing the intersection of two vector sets. * * This class is used to determine if a vector belongs to the intersection of - * two vector sets. It is useful for handling a posterior PDF, since its domain - * is the intersection of the domain of the prior PDF with the domain of the + * two vector sets. It is useful for handling a posterior PDF, since its domain + * is the intersection of the domain of the prior PDF with the domain of the * likelihood function.*/ template class IntersectionSubset : public VectorSubset { public: //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default, shaped constructor. /*! Creates the class for the intersection of two vector sets, given a vector space, its volume and the * sets.*/ @@ -51,33 +51,33 @@ class IntersectionSubset : public VectorSubset { double volume, const VectorSet& set1, const VectorSet& set2); - + //! Destructor. ~IntersectionSubset(); //@} - + //! @name Mathematical methods. - //@{ + //@{ //! Determines whether both sets m_set1 and m_set2 (class' private attributes) contain vector \c vec. bool contains(const V& vec) const; //@} - + //! @name I/O methods. - //@{ + //@{ //! Prints both subsets (via protected attributes m_set1 and m_set2). void print (std::ostream& os) const; //@} - + protected: using VectorSet ::m_env; using VectorSet ::m_prefix; using VectorSet ::m_volume; using VectorSubset::m_vectorSpace; - - //! Vector set: m_set1. + + //! Vector set: m_set1. /*! We seek the intersection of vectors set m_set1 and m_set2.*/ const VectorSet& m_set1; - + //! Vector set: m_set2. const VectorSet& m_set2; }; diff --git a/src/basic/inc/ScalarFunctionSynchronizer.h b/src/basic/inc/ScalarFunctionSynchronizer.h index 17d8c442f..c15b00db2 100644 --- a/src/basic/inc/ScalarFunctionSynchronizer.h +++ b/src/basic/inc/ScalarFunctionSynchronizer.h @@ -32,12 +32,12 @@ namespace QUESO { /*! \file ScalarFunctionSynchronizer.h * \brief Class for synchronizing the calls of scalar functions - * + * * \class ScalarFunctionSynchronizer * \brief A templated class for synchronizing the calls of scalar functions (BaseScalarFunction and derived classes). * - * This class creates a synchronization point among processes which call scalar functions. - * This means that all processes must reach a point in their code before they can all begin + * This class creates a synchronization point among processes which call scalar functions. + * This means that all processes must reach a point in their code before they can all begin * executing again. */ template @@ -45,25 +45,25 @@ class ScalarFunctionSynchronizer { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. ScalarFunctionSynchronizer(const BaseScalarFunction& inputFunction, const V& auxVec); - + //! Destructor. ~ScalarFunctionSynchronizer(); //@} - + //! @name Mathematical methods - //@{ + //@{ //! Access to the domain set of the scalar function which will be synchronized. const VectorSet& domainSet() const; //@} - + //! @name Sync method - //@{ + //@{ //! Calls the scalar function which will be synchronized. - /*! This procedure forms a barrier, and no processes in the communicator can pass the + /*! This procedure forms a barrier, and no processes in the communicator can pass the * barrier until all of them call the function. */ double callFunction(const V* vecValues, const V* vecDirection, @@ -72,7 +72,7 @@ class ScalarFunctionSynchronizer V* hessianEffect, double* extraOutput1, double* extraOutput2) const; - //@} + //@} private: const BaseEnvironment& m_env; const BaseScalarFunction& m_scalarFunction; diff --git a/src/basic/inc/ScalarSequence.h b/src/basic/inc/ScalarSequence.h index 781a9ddac..23efc5f5f 100644 --- a/src/basic/inc/ScalarSequence.h +++ b/src/basic/inc/ScalarSequence.h @@ -42,12 +42,12 @@ namespace QUESO { /*! \file ScalarSequence.h * \brief A templated class for handling scalar samples. - * + * * \class ScalarSequence * \brief Class for handling scalar samples. * - * This class handles scalar samples generated by an algorithm, as well - * as operations that can be carried over them, e.g., calculation of means, + * This class handles scalar samples generated by an algorithm, as well + * as operations that can be carried over them, e.g., calculation of means, * correlation and covariance matrices. */ template @@ -60,7 +60,7 @@ class ScalarSequence typedef typename std::vector::const_iterator seqScalarPositionConstIteratorTypedef; //@} //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. ScalarSequence(const BaseEnvironment& env, unsigned int subSequenceSize, @@ -68,107 +68,107 @@ class ScalarSequence //! Destructor. ~ScalarSequence(); //@} - + //! @name Set methods //@{ //! Assignment operator; it copies \c rhs to \c this. ScalarSequence& operator= (const ScalarSequence& rhs); //@} - + //! @name Access methods //@{ - //! Access position \c posId of the sequence of scalars (const). + //! Access position \c posId of the sequence of scalars (const). const T& operator[] (unsigned int posId) const; - + //! Access position \c posId of the sequence of scalars (non-const). /*! This routine deletes all stored computed scalars. */ - T& operator[] (unsigned int posId); + T& operator[] (unsigned int posId); //@} - + //! @name Sequence methods //@{ - //! Access to QUESO environment. + //! Access to QUESO environment. const BaseEnvironment& env () const; - + //! Access to the name of the sequence of scalars. const std::string& name () const; - + //! Sets a new name to the sequence of scalars. void setName (const std::string& newName); - + //! Clears the sequence of scalars. /*! Resets its values and then its size to zero.*/ void clear (); - - //! Size of the sub-sequence of scalars. + + //! Size of the sub-sequence of scalars. unsigned int subSequenceSize () const; - + //! Size of the unified sequence of scalars. unsigned int unifiedSequenceSize (bool useOnlyInter0Comm) const; - + //! Resizes the size of the sequence of scalars. /*! This routine deletes all stored computed scalars. */ void resizeSequence (unsigned int newSequenceSize); - + //! Sets \c numPos values of the sequence to zero, starting at position \c initialPos. /*! This routine deletes all stored computed scalars. */ void resetValues (unsigned int initialPos, unsigned int ); - + //! Erases \c numPos values of the sequence, starting at position \c initialPos. /*! This routine deletes all stored computed scalars. */ void erasePositions (unsigned int initialPos, unsigned int numPos); - + //! Gets the unified contents of processor of rank equals to 0. void getUnifiedContentsAtProc0Only(bool useOnlyInter0Comm, std::vector& outputVec) const; //! Finds the minimum value of the sub-sequence of scalars. const T& subMinPlain () const; - + //! Finds the minimum value of the unified sequence of scalars. const T& unifiedMinPlain (bool useOnlyInter0Comm) const; - + //! Finds the maximum value of the sub-sequence of scalars. const T& subMaxPlain () const; - - //! Finds the maximum value of the unified sequence of scalars. + + //! Finds the maximum value of the unified sequence of scalars. const T& unifiedMaxPlain (bool useOnlyInter0Comm) const; - - //! Finds the mean value of the sub-sequence of scalars. + + //! Finds the mean value of the sub-sequence of scalars. const T& subMeanPlain () const; - + //! Finds the mean value of the unified sequence of scalars. const T& unifiedMeanPlain (bool useOnlyInter0Comm) const; - + //! Finds the median value of the sub-sequence of scalars. const T& subMedianPlain () const; - + //! Finds the median value of the unified sequence of scalars. const T& unifiedMedianPlain (bool useOnlyInter0Comm) const; - + //! Finds the variance of a sample of the sub-sequence of scalars. const T& subSampleVariancePlain () const; - + //! Finds the variance of a sample of the unified sequence of scalars. const T& unifiedSampleVariancePlain (bool useOnlyInter0Comm) const; - + //! Deletes all stored scalars. void deleteStoredScalars (); - + //! Sets the values of the sequence as a Gaussian distribution of mean given by \c meanVec and standard deviation by \c stdDevVec. /*! This routine deletes all stored computed scalars. */ - void setGaussian (const T& mean, const T& stdDev); - + void setGaussian (const T& mean, const T& stdDev); + //! Sets the values of the sequence as a uniform distribution between the values given by vectors \c aVec and \c bVec. /*! This routine deletes all stored computed scalars. */ - void setUniform (const T& a, const T& b ); - + void setUniform (const T& a, const T& b ); + //! Uniformly samples from the CDF from the sub-sequence. void subUniformlySampledCdf (unsigned int numIntervals, T& minDomainValue, T& maxDomainValue, std::vector& cdfValues) const; - + //! Uniformly samples from the CDF from the unified sequence. void unifiedUniformlySampledCdf (bool useOnlyInter0Comm, unsigned int numIntervals, @@ -183,35 +183,35 @@ class ScalarSequence void subWeightCdf (unsigned int numIntervals, std::vector& gridValues, std::vector& cdfValues) const; - - //! Finds the Weighted Cumulative Distribution Function (CDF) of the sub-sequence of scalars. + + //! Finds the Weighted Cumulative Distribution Function (CDF) of the sub-sequence of scalars. void subWeightCdf (unsigned int numIntervals, UniformOneDGrid*& gridValues, std::vector& cdfValues) const; - + //! Finds the mean value of the sub-sequence, considering \c numPos positions starting at position \c initialPos. T subMeanExtra (unsigned int initialPos, unsigned int numPos) const; - - //! Finds the mean value of the unified sequence of \c numPos positions starting at position \c initialPos. + + //! Finds the mean value of the unified sequence of \c numPos positions starting at position \c initialPos. T unifiedMeanExtra (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos) const; - + //! Finds the median value of the sub-sequence, considering \c numPos positions starting at position \c initialPos. T subMedianExtra (unsigned int initialPos, unsigned int numPos) const; - + //! Finds the median value of the unified sequence, considering \c numPos positions starting at position \c initialPos. T unifiedMedianExtra (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int localNumPos) const; //! Finds the sample variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. - /*! Output: calculated sample variance of the sub-sequence of scalars. - * The sample variance @f$ \sigma_y^2 @f$ is the second sample central moment and is defined by - * @f$ \sigma_y^2 = \frac{1}{n} \sum_{i=1}^n \left(y_i - \mu \right)^2 @f$, where @f$ \mu @f$ is - * the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the initial + /*! Output: calculated sample variance of the sub-sequence of scalars. + * The sample variance @f$ \sigma_y^2 @f$ is the second sample central moment and is defined by + * @f$ \sigma_y^2 = \frac{1}{n} \sum_{i=1}^n \left(y_i - \mu \right)^2 @f$, where @f$ \mu @f$ is + * the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the initial * position and the number of elements of the sequence which will be used to evaluate the sample variance.*/ T subSampleVarianceExtra (unsigned int initialPos, unsigned int numPos, @@ -231,54 +231,54 @@ class ScalarSequence unsigned int initialPos, unsigned int localNumPos, const T& unifiedMeanValue) const; - //! Finds the population variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanValue. - /*! Output: calculated population variance of the sub-sequence of scalars. - * The population variance @f$ \sigma^2 @f$ is defined by + //! Finds the population variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanValue. + /*! Output: calculated population variance of the sub-sequence of scalars. + * The population variance @f$ \sigma^2 @f$ is defined by * @f$ \sigma^2 = \frac{1}{n-1} \sum_{i=1}^n \left(y_i - \mu \right)^2 @f$, where @f$ \mu @f$ - * is the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the - * initial position and the number of elements of the sequence which will be used to evaluate the - * population variance .*/ + * is the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the + * initial position and the number of elements of the sequence which will be used to evaluate the + * population variance .*/ T subPopulationVariance (unsigned int initialPos, unsigned int numPos, const T& meanValue) const; - //! Finds the population variance of the unified sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanValue. + //! Finds the population variance of the unified sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanValue. /*! Output: calculated population variance of the unified sequence of scalars. */ T unifiedPopulationVariance (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, const T& unifiedMeanValue) const; //! Calculates the autocovariance. - /*! The autocovariance is the covariance of a variable with itself at some other time. It is - * calculated over a sequence of scalars with initial position \c initialPos, considering - * \c numPos positions, a lag of \c lag, with mean given by \c meanValue. - * Output: the calculated autocovariances of the sequence of scalars. */ + /*! The autocovariance is the covariance of a variable with itself at some other time. It is + * calculated over a sequence of scalars with initial position \c initialPos, considering + * \c numPos positions, a lag of \c lag, with mean given by \c meanValue. + * Output: the calculated autocovariances of the sequence of scalars. */ T autoCovariance (unsigned int initialPos, unsigned int numPos, const T& meanValue, unsigned int lag) const; - + //! Calculates the autocorrelation via definition. - /*! Autocorrelation is the cross-correlation of a variable with itself; it describes the + /*! Autocorrelation is the cross-correlation of a variable with itself; it describes the * correlation between values of the process at different times, as a function of the two - * times. It is calculated over a sequence of vectors with initial position \c initialPos, - * considering \c numPos positions, a lag of \c lag, with mean given by \c meanValue. - * Output: the calculated autocorrelations of the sequence of vectors. */ + * times. It is calculated over a sequence of vectors with initial position \c initialPos, + * considering \c numPos positions, a lag of \c lag, with mean given by \c meanValue. + * Output: the calculated autocorrelations of the sequence of vectors. */ T autoCorrViaDef (unsigned int initialPos, unsigned int numPos, unsigned int lag) const; - - //! Calculates the autocorrelation via Fast Fourier transforms (FFT). + + //! Calculates the autocorrelation via Fast Fourier transforms (FFT). void autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int maxLag, std::vector& autoCorrs) const; - - //! Calculates the sum of autocorrelation via Fast Fourier transforms (FFT). + + //! Calculates the sum of autocorrelation via Fast Fourier transforms (FFT). void autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int numSum, T& autoCorrsSum) const; - //! Finds the minimum and the maximum values of the sub-sequence, considering \c numPos positions starting at position \c initialPos. + //! Finds the minimum and the maximum values of the sub-sequence, considering \c numPos positions starting at position \c initialPos. void subMinMaxExtra (unsigned int initialPos, unsigned int numPos, T& minValue, @@ -290,9 +290,9 @@ class ScalarSequence T& unifiedMinValue, T& unifiedMaxValue) const; //! Calculates the histogram of the sub-sequence. - /*! It requires the specification of the maximum (\c maxHorizontalValue) and the minimum - * (\c minHorizontalValue) values if the data and the initial position (\c initialPos) - * from where the data will be considered. Output: the center of each bin (\c centers) + /*! It requires the specification of the maximum (\c maxHorizontalValue) and the minimum + * (\c minHorizontalValue) values if the data and the initial position (\c initialPos) + * from where the data will be considered. Output: the center of each bin (\c centers) * and the number of data occurrences in each bin (\c bins).*/ void subHistogram (unsigned int initialPos, const T& minHorizontalValue, @@ -307,9 +307,9 @@ class ScalarSequence std::vector& unifiedCenters, std::vector& unifiedBins) const; //! Calculates the histogram of the sub-sequence. - /*! It requires the specification of the maximum (\c maxHorizontalValue) and the minimum - * (\c minHorizontalValue) values if the data and the initial position (\c initialPos) - * from where the data will be considered. Output: grid values that will act as the center + /*! It requires the specification of the maximum (\c maxHorizontalValue) and the minimum + * (\c minHorizontalValue) values if the data and the initial position (\c initialPos) + * from where the data will be considered. Output: grid values that will act as the center * of each bin (\c gridValues) and the number of data occurrences in each bin (\c bins).*/ void subBasicHistogram (unsigned int initialPos, const T& minHorizontalValue, @@ -318,9 +318,9 @@ class ScalarSequence std::vector& bins) const; //! Calculates the weighted histogram of the sub-sequence. /*! TODO:Note that this method is exactly the same as subBasicHistogram().*/ - /*! It requires the specification of the maximum (\c maxHorizontalValue) and the minimum - * (\c minHorizontalValue) values if the data and the initial position (\c initialPos) - * from where the data will be considered. Output: grid values that will act as the center + /*! It requires the specification of the maximum (\c maxHorizontalValue) and the minimum + * (\c minHorizontalValue) values if the data and the initial position (\c initialPos) + * from where the data will be considered. Output: grid values that will act as the center * of each bin (\c gridValues) and the number of data occurrences in each bin (\c bins).*/ void subWeightHistogram (unsigned int initialPos, const T& minHorizontalValue, @@ -328,7 +328,7 @@ class ScalarSequence UniformOneDGrid*& gridValues, std::vector& bins) const; //! Calculates the weighted histogram of the sub-sequence. - /*! In this method, \c gridValues is a std::vector, but internally, it will be copied to an + /*! In this method, \c gridValues is a std::vector, but internally, it will be copied to an * structure of the type UniformOneDGrid. */ void subWeightHistogram (unsigned int initialPos, const T& minHorizontalValue, @@ -342,31 +342,31 @@ class ScalarSequence void unifiedSort (bool useOnlyInter0Comm, unsigned int initialPos, ScalarSequence& unifiedSortedSequence) const; - //! Returns the interquartile range of the values in the sub-sequence. + //! Returns the interquartile range of the values in the sub-sequence. /*! The IQR is a robust estimate of the spread of the data, since changes in the upper and - * lower 25% of the data do not affect it. If there are outliers in the data, then the IQR - * is more representative than the standard deviation as an estimate of the spread of the - * body of the data. The IQR is less efficient than the standard deviation as an estimate + * lower 25% of the data do not affect it. If there are outliers in the data, then the IQR + * is more representative than the standard deviation as an estimate of the spread of the + * body of the data. The IQR is less efficient than the standard deviation as an estimate * of the spread when the data is all from the normal distribution. (from Matlab)*/ T subInterQuantileRange (unsigned int initialPos) const; - + //! Returns the interquartile range of the values in the unified sequence. T unifiedInterQuantileRange (bool useOnlyInter0Comm, unsigned int initialPos) const; - + //! Selects the scales (output value) for the kernel density estimation, considering only the sub-sequence. - /*! The bandwidth of the kernel is a free parameter which exhibits a strong influence on + /*! The bandwidth of the kernel is a free parameter which exhibits a strong influence on * the resulting estimate. Silverman (1986) suggests the following normal-based estimates: * S1 = 1.06 Ɨ (standard deviation) Ɨ n^{-1/5} * S2 = 0.79 Ɨ (\c iqrValue) Ɨ n^{-1/5}, where \c iqrValue is the interquartile range * OutputValue = 0.90 Ɨ minimum(standard deviation, \c iqrValue /1.34) Ɨ n^{-1/5}. - * These estimates are popular due to their simplicity, and are used in QUESO with the - * adaptation of the exponent oven the sample size n (-1/5) with -1/(4 + \c kdeDimension) + * These estimates are popular due to their simplicity, and are used in QUESO with the + * adaptation of the exponent oven the sample size n (-1/5) with -1/(4 + \c kdeDimension) * where \c kdeDimension is the KDE dimension. */ T subScaleForKde (unsigned int initialPos, const T& iqrValue, unsigned int kdeDimension) const; - + //! Selects the scales (bandwidth) for the kernel density estimation, considering the unified sequence. T unifiedScaleForKde (bool useOnlyInter0Comm, unsigned int initialPos, @@ -374,14 +374,14 @@ class ScalarSequence unsigned int kdeDimension) const; //! Gaussian kernel for the KDE estimate of the sub-sequence. /*! Computes a probability density estimate of the sample in \c this sub-sequence, starting - * at position \c initialPos. \c densityValues is the vector of density values evaluated at - * the points in \c evaluationPositions. The estimate is based on Gaussian (normal) kernel + * at position \c initialPos. \c densityValues is the vector of density values evaluated at + * the points in \c evaluationPositions. The estimate is based on Gaussian (normal) kernel * function, using a window parameter (\c scaleValue).*/ void subGaussian1dKde (unsigned int initialPos, double scaleValue, const std::vector& evaluationPositions, std::vector& densityValues) const; - + //! Gaussian kernel for the KDE estimate of the unified sequence. void unifiedGaussian1dKde (bool useOnlyInter0Comm, unsigned int initialPos, @@ -394,7 +394,7 @@ class ScalarSequence void filter (unsigned int initialPos, unsigned int spacing); - //! Estimates convergence rate using Brooks & Gelman method. + //! Estimates convergence rate using Brooks & Gelman method. /*! TODO: implement me!*/ T brooksGelmanConvMeasure (bool useOnlyInter0Comm, unsigned int initialPos, @@ -411,29 +411,29 @@ class ScalarSequence //! Finds the positions where the maximum element occurs in the unified sequence. T unifiedPositionsOfMaximum (const ScalarSequence& subCorrespondingScalarValues, ScalarSequence& unifiedPositionsOfMaximum); - - //! Writes the sub-sequence to a file. + + //! Writes the sub-sequence to a file. /*! Given the allowed sub environments (\c allowedSubEnvIds) that are allowed to write to file, * together with the file name and type (\c fileName, \c fileType), it writes the entire sub- - * sequence to the file. The sum of the initial position of the sequence (\c initialPos) with + * sequence to the file. The sum of the initial position of the sequence (\c initialPos) with * the number of positions that will be written (\c numPos) must equal the size of the sequence. */ void subWriteContents (unsigned int initialPos, unsigned int numPos, const std::string& fileName, const std::string& fileType, const std::set& allowedSubEnvIds) const; - //! Writes the sub-sequence to a file. + //! Writes the sub-sequence to a file. /*! Uses object of the type std::ofstream. */ void subWriteContents (unsigned int initialPos, unsigned int numPos, std::ofstream& ofs, const std::string& fileType) const; - //! Writes the unified sequence to a file. + //! Writes the unified sequence to a file. /*! Writes the unified sequence in Matlab/Octave format or, if enabled, in HDF5 format.*/ void unifiedWriteContents (const std::string& fileName, const std::string& fileType) const; - - //! Reads the unified sequence from a file. + + //! Reads the unified sequence from a file. void unifiedReadContents (const std::string& fileName, const std::string& fileType, const unsigned int subSequenceSize); @@ -450,13 +450,13 @@ class ScalarSequence T meanStacc (unsigned int initialPos) const; void subCdfPercentageRange (unsigned int initialPos, unsigned int numPos, - double range, // \in [0,1] + double range, // \in [0,1] T& lowerValue, T& upperValue) const; void unifiedCdfPercentageRange (bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, - double range, // \in [0,1] + double range, // \in [0,1] T& lowerValue, T& upperValue) const; @@ -483,9 +483,9 @@ class ScalarSequence //@} private: //! Copies the scalar sequence \c src to \c this. - /*! This routine deletes all stored computed scalars. */ - void copy (const ScalarSequence& src); - + /*! This routine deletes all stored computed scalars. */ + void copy (const ScalarSequence& src); + //! Extracts a sequence of scalars. /*! The sequence of scalars has size \c numPos, and it will be extracted starting at position * (\c initialPos) of \c this sequence of scalars, given spacing \c spacing.*/ @@ -493,26 +493,26 @@ class ScalarSequence unsigned int spacing, unsigned int numPos, ScalarSequence& scalarSeq) const; - //! Extracts the raw data. + //! Extracts the raw data. /*! This method saves in \c rawData the data from the sequence of scalars (in private - * attribute \c m_seq) starting at position (\c initialPos), with a spacing + * attribute \c m_seq) starting at position (\c initialPos), with a spacing * of \c spacing until \c numPos positions have been extracted. */ void extractRawData (unsigned int initialPos, unsigned int spacing, unsigned int numPos, std::vector& rawData) const; - - //! The sequence of scalars. Access to private attribute \c m_seq. + + //! The sequence of scalars. Access to private attribute \c m_seq. std::vector& rawData (); - + //! Sorts the sequence of scalars in the private attribute \c m_seq. void subSort (); - + //! Sorts/merges data in parallel using MPI. void parallelMerge (std::vector& sortedBuffer, const std::vector& leafData, unsigned int treeLevel) const; - + const BaseEnvironment& m_env; std::string m_name; std::vector m_seq; diff --git a/src/basic/inc/SequenceOfVectors.h b/src/basic/inc/SequenceOfVectors.h index d55edfdab..9debb4581 100644 --- a/src/basic/inc/SequenceOfVectors.h +++ b/src/basic/inc/SequenceOfVectors.h @@ -33,28 +33,28 @@ namespace QUESO { /*! \file SequenceofVectors.h * \brief A templated class for handling vector samples - * + * * \class SequenceOfVectors * \brief Class for handling vector samples (sequence of vectors). * - * This class handles vector samples generated by an algorithm, as well as - * operations that can be carried over them, e.g., calculation of means, - * correlation and covariance matrices. It is derived from and implements + * This class handles vector samples generated by an algorithm, as well as + * operations that can be carried over them, e.g., calculation of means, + * correlation and covariance matrices. It is derived from and implements * BaseVectorSequence.*/ template class SequenceOfVectors : public BaseVectorSequence { public: - + //! @name Class typedefs //@{ typedef typename std::vector::const_iterator seqVectorPositionConstIteratorTypedef; typedef typename std::vector::iterator seqVectorPositionIteratorTypedef; //@} - + //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. SequenceOfVectors(const VectorSpace& vectorSpace, unsigned int subSequenceSize, @@ -62,34 +62,34 @@ class SequenceOfVectors : public BaseVectorSequence //! Destructor. ~SequenceOfVectors(); //@} - + //! @name Set methods - //@{ - //! Copies values from \c rhs to \c this. + //@{ + //! Copies values from \c rhs to \c this. SequenceOfVectors& operator= (const SequenceOfVectors& rhs); //@} - + //! @name Sequence methods - //@{ + //@{ //! Size of the sub-sequence of vectors. unsigned int subSequenceSize () const; - + //! Resizes the sequence. /*! This routine deletes all stored computed vectors */ - void resizeSequence (unsigned int newSubSequenceSize); - + void resizeSequence (unsigned int newSubSequenceSize); + //! Resets a total of \c numPos values of the sequence starting at position \c initialPos. /*! This routine deletes all stored computed vectors */ - void resetValues (unsigned int initialPos, unsigned int numPos); - + void resetValues (unsigned int initialPos, unsigned int numPos); + //! Erases \c numPos elements of the sequence starting at position \c initialPos. /*! This routine deletes all stored computed vectors */ - void erasePositions (unsigned int initialPos, unsigned int numPos); + void erasePositions (unsigned int initialPos, unsigned int numPos); //! Gets the values of the sequence at position \c posId and stores them at \c vec. void getPositionValues (unsigned int posId, V& vec) const; - //! Set the values in \c vec at position \c posId of the sequence. + //! Set the values in \c vec at position \c posId of the sequence. /*! This routine deletes all stored computed vectors */ void setPositionValues (unsigned int posId, const V& vec); @@ -114,23 +114,23 @@ class SequenceOfVectors : public BaseVectorSequence unsigned int numPos, V& unifiedMeanVec) const; - //! Finds the median value of the sub-sequence, considering \c numPos positions starting at position \c initialPos. + //! Finds the median value of the sub-sequence, considering \c numPos positions starting at position \c initialPos. /*! Output: \param medianVec is the vector of the calculated medians of the sub-sequence of vectors. */ void subMedianExtra (unsigned int initialPos, unsigned int numPos, V& medianVec) const; - - //! Finds the median value of the unfed sequence, considering \c numPos positions starting at position \c initialPos. + + //! Finds the median value of the unfed sequence, considering \c numPos positions starting at position \c initialPos. /*! Output: \param medianVec is the vector of the calculated medians of the unified sequence of vectors. */ void unifiedMedianExtra (unsigned int initialPos, unsigned int numPos, V& unifiedMedianVec) const; //! Finds the sample variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. - /*! Output: \param samVec is the vector of the calculated sample variance of the sub-sequence of vectors. - * The sample variance @f$ \sigma_y^2 @f$ is the second sample central moment and is defined by - * @f$ \sigma_y^2 = \frac{1}{n} \sum_{i=1}^n \left(y_i - \mu \right)^2 @f$, where @f$ \mu @f$ is - * the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the initial - * position and the number of elements of the sequence which will be used to evaluate the sample variance.*/ + /*! Output: \param samVec is the vector of the calculated sample variance of the sub-sequence of vectors. + * The sample variance @f$ \sigma_y^2 @f$ is the second sample central moment and is defined by + * @f$ \sigma_y^2 = \frac{1}{n} \sum_{i=1}^n \left(y_i - \mu \right)^2 @f$, where @f$ \mu @f$ is + * the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the initial + * position and the number of elements of the sequence which will be used to evaluate the sample variance.*/ void subSampleVarianceExtra (unsigned int initialPos, unsigned int numPos, const V& meanVec, @@ -141,7 +141,7 @@ class SequenceOfVectors : public BaseVectorSequence unsigned int numPos, const V& unifiedMeanVec, V& unifiedSamVec) const; - + //! Finds the sample standard deviation of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. /*! Output: \param stdVec is the vector of the calculated sample standard deviation of the sub-sequence of vectors.*/ void subSampleStd (unsigned int initialPos, @@ -155,58 +155,58 @@ class SequenceOfVectors : public BaseVectorSequence const V& unifiedMeanVec, V& unifiedStdVec) const; - //! Finds the population variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. - /*! Output: \param popVec is the vector of the calculated population variance of the sub-sequence of vectors. - * The population variance @f$ \sigma^2 @f$ is defined by + //! Finds the population variance of the sub-sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. + /*! Output: \param popVec is the vector of the calculated population variance of the sub-sequence of vectors. + * The population variance @f$ \sigma^2 @f$ is defined by * @f$ \sigma^2 = \frac{1}{n-1} \sum_{i=1}^n \left(y_i - \mu \right)^2 @f$, where @f$ \mu @f$ - * is the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the - * initial position and the number of elements of the sequence which will be used to evaluate the - * population variance .*/ + * is the sample mean and @f$ n @f$ is the sample size. This procedure lets the users choose the + * initial position and the number of elements of the sequence which will be used to evaluate the + * population variance .*/ void subPopulationVariance (unsigned int initialPos, unsigned int numPos, const V& meanVec, V& popVec) const; - - //! Finds the population variance of the unified sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. + + //! Finds the population variance of the unified sequence, considering \c numPos positions starting at position \c initialPos and of mean \c meanVec. /*! Output: \param popVec is the vector of the calculated population variance of the unified sequence of vectors.*/ void unifiedPopulationVariance (unsigned int initialPos, unsigned int numPos, const V& unifiedMeanVec, V& unifiedPopVec) const; - + //! Calculates the autocovariance. - /*! The autocovariance is the covariance of a variable with itself at some other time. It is - * calculated over a sequence of vectors with initial position \c initialPos, considering - * \c numPos positions, a lag of \c lag, with mean given by \c meanVec. Output: - * \param covVec is the vector of the calculated autocovariances of the sequence of vectors. */ + /*! The autocovariance is the covariance of a variable with itself at some other time. It is + * calculated over a sequence of vectors with initial position \c initialPos, considering + * \c numPos positions, a lag of \c lag, with mean given by \c meanVec. Output: + * \param covVec is the vector of the calculated autocovariances of the sequence of vectors. */ void autoCovariance (unsigned int initialPos, unsigned int numPos, const V& meanVec, unsigned int lag, V& covVec) const; - + //! Calculates the autocorrelation via definition. - /*! Autocorrelation is the cross-correlation of a variable with itself; it describes the + /*! Autocorrelation is the cross-correlation of a variable with itself; it describes the * correlation between values of the process at different times, as a function of the two - * times. It is calculated over a sequence of vectors with initial position \c initialPos, - * considering \c numPos positions, a lag of \c lag, with mean given by \c meanVec. Output: - * \param corrVec is the vector of the calculated autocorrelations of the sequence of vectors. */ + * times. It is calculated over a sequence of vectors with initial position \c initialPos, + * considering \c numPos positions, a lag of \c lag, with mean given by \c meanVec. Output: + * \param corrVec is the vector of the calculated autocorrelations of the sequence of vectors. */ void autoCorrViaDef (unsigned int initialPos, unsigned int numPos, unsigned int lag, V& corrVec) const; - //! Calculates the autocorrelation via Fast Fourier transforms (FFT). + //! Calculates the autocorrelation via Fast Fourier transforms (FFT). void autoCorrViaFft (unsigned int initialPos, unsigned int numPos, const std::vector& lags, std::vector& corrVecs) const; - - //! Calculates the autocorrelation via Fast Fourier transforms (FFT). + + //! Calculates the autocorrelation via Fast Fourier transforms (FFT). void autoCorrViaFft (unsigned int initialPos, unsigned int numPos, unsigned int numSum, V& autoCorrsSumVec) const; - //! Finds the minimum and the maximum values of the sub-sequence, considering \c numPos positions starting at position \c initialPos. + //! Finds the minimum and the maximum values of the sub-sequence, considering \c numPos positions starting at position \c initialPos. void subMinMaxExtra (unsigned int initialPos, unsigned int numPos, V& minVec, @@ -219,7 +219,7 @@ class SequenceOfVectors : public BaseVectorSequence //! Calculates the histogram of the sub-sequence. /*! It requires the specification of the number of bins that the histogram will have, the center of * each bin and the initial position where the data will be considered. */ - // TODO explain params minVec and maxVec + // TODO explain params minVec and maxVec void subHistogram (unsigned int initialPos, const V& minVec, const V& maxVec, @@ -231,28 +231,28 @@ class SequenceOfVectors : public BaseVectorSequence const V& unifiedMaxVec, std::vector& unifiedCentersForAllBins, std::vector& unifiedQuanttsForAllBins) const; - - //! Returns the interquartile range of the values in the sub-sequence. + + //! Returns the interquartile range of the values in the sub-sequence. /*! The IQR is a robust estimate of the spread of the data, since changes in the upper and - * lower 25% of the data do not affect it. If there are outliers in the data, then the IQR - * is more representative than the standard deviation as an estimate of the spread of the - * body of the data. The IQR is less efficient than the standard deviation as an estimate + * lower 25% of the data do not affect it. If there are outliers in the data, then the IQR + * is more representative than the standard deviation as an estimate of the spread of the + * body of the data. The IQR is less efficient than the standard deviation as an estimate * of the spread when the data is all from the normal distribution. (from Matlab)*/ void subInterQuantileRange (unsigned int initialPos, V& iqrVec) const; - - //! Returns the interquartile range of the values in the unified sequence. + + //! Returns the interquartile range of the values in the unified sequence. void unifiedInterQuantileRange (unsigned int initialPos, V& unifiedIqrVec) const; - + //! Selects the scales (bandwidth, \c scaleVec) for the kernel density estimation, considering only the sub-sequence. - /*! The bandwidth of the kernel is a free parameter which exhibits a strong influence on + /*! The bandwidth of the kernel is a free parameter which exhibits a strong influence on * the resulting estimate. Silverman (1986) suggests the following normal-based estimates: * S1 = 1.06 Ɨ (standard deviation) Ɨ n^{-1/5} * S2 = 0.79 Ɨ (\c iqrVec) Ɨ n^{-1/5}, where \c iqrVec is the interquartile range * \c scaleVec = 0.90 Ɨ minimum(standard deviation, \c iqrVec /1.34) Ɨ n^{-1/5}. - * These estimates are popular due to their simplicity, and are used in QUESO with the - * adaptation of the exponent oven the sample size n (-1/5) with -1/(4 + \c kdeDimension) + * These estimates are popular due to their simplicity, and are used in QUESO with the + * adaptation of the exponent oven the sample size n (-1/5) with -1/(4 + \c kdeDimension) * where \c kdeDimension is the KDE dimension. */ void subScalesForKde (unsigned int initialPos, const V& iqrVec, @@ -265,9 +265,9 @@ class SequenceOfVectors : public BaseVectorSequence V& unifiedScaleVec) const; //! Gaussian kernel for the KDE estimate of the sub-sequence. /*! Computes a probability density estimate of the sample in \c this sub-sequence, starting - * at position \c initialPos. \c densityVecs is the vector of density values evaluated at - * the points in \c evaluationParamVecs. The estimate is based on Gaussian (normal) kernel - * function, using a window parameter (\c scaleVec).*/ + * at position \c initialPos. \c densityVecs is the vector of density values evaluated at + * the points in \c evaluationParamVecs. The estimate is based on Gaussian (normal) kernel + * function, using a window parameter (\c scaleVec).*/ void subGaussian1dKde (unsigned int initialPos, const V& scaleVec, const std::vector& evalParamVecs, @@ -277,10 +277,10 @@ class SequenceOfVectors : public BaseVectorSequence const V& unifiedScaleVec, const std::vector& unifiedEvalParamVecs, std::vector& unifiedDensityVecs) const; - //! Writes the sub-sequence to a file. + //! Writes the sub-sequence to a file. /*! Given the allowed sub environments (\c allowedSubEnvIds) that are allowed to write to file, * together with the file name and type (\c fileName, \c fileType), it writes the entire sub- - * sequence to the file. The sum of the initial position of the sequence (\c initialPos) with + * sequence to the file. The sum of the initial position of the sequence (\c initialPos) with * the number of positions that will be written (\c numPos) must equal the size of the sequence. * This procedure calls void subWriteContents (unsigned int initialPos, unsigned int numPos, * FilePtrSetStruct& filePtrSet, const std::string& fileType). */ @@ -289,36 +289,36 @@ class SequenceOfVectors : public BaseVectorSequence const std::string& fileName, const std::string& fileType, const std::set& allowedSubEnvIds) const; - //! Writes the sub-sequence to a file. + //! Writes the sub-sequence to a file. /*! Uses additional variable of the type FilePtrSetStruct& to operate on files. */ void subWriteContents (unsigned int initialPos, unsigned int numPos, FilePtrSetStruct& filePtrSet, const std::string& fileType) const; - //! Writes the sub-sequence to a file. + //! Writes the sub-sequence to a file. /*! Uses object of the type std::ofstream. */ void subWriteContents (unsigned int initialPos, unsigned int numPos, std::ofstream& ofs, const std::string& fileType) const; - //! Writes the unfed sequence to a file. + //! Writes the unfed sequence to a file. //! Writes the unified sequence in Matlab/Octave format or, if enabled, in HDF5 format. void unifiedWriteContents (const std::string& fileName, const std::string& fileType) const; - - //! Reads the unified sequence from a file. + + //! Reads the unified sequence from a file. void unifiedReadContents (const std::string& fileName, const std::string& fileType, const unsigned int subSequenceSize); //! TODO: It shall select positions in the sequence of vectors. void select (const std::vector& idsOfUniquePositions); - + //! Filters positions in the sequence of vectors. /*! Filtered positions will starting at \c initialPos, and with spacing given by \c spacing. */ void filter (unsigned int initialPos, unsigned int spacing); - //! Estimates convergence rate using Brooks & Gelman method. + //! Estimates convergence rate using Brooks & Gelman method. double estimateConvBrooksGelman (unsigned int initialPos, unsigned int numPos) const; @@ -341,7 +341,7 @@ class SequenceOfVectors : public BaseVectorSequence ArrayOfOneDGrids & mdfGrids, ArrayOfOneDTables& mdfValues) const; #endif - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS void subMeanCltStd (unsigned int initialPos, unsigned int numPos, @@ -376,18 +376,18 @@ class SequenceOfVectors : public BaseVectorSequence V& meanStaccVec) const; void subCdfPercentageRange (unsigned int initialPos, unsigned int numPos, - double range, // \in [0,1] + double range, // \in [0,1] V& lowerVec, V& upperVec) const; void unifiedCdfPercentageRange (unsigned int initialPos, unsigned int numPos, - double range, // \in [0,1] + double range, // \in [0,1] V& lowerVec, V& upperVec) const; void subCdfStacc (unsigned int initialPos, std::vector& cdfStaccVecs, std::vector& cdfStaccVecsUp, - std::vector& cdfStaccVecsLow, + std::vector& cdfStaccVecsLow, std::vector& sortedDataVecs) const; void subCdfStacc (unsigned int initialPos, const std::vector& evalPositionsVecs, @@ -397,10 +397,10 @@ class SequenceOfVectors : public BaseVectorSequence private: //! Copies vector sequence \c src to \c this. void copy (const SequenceOfVectors& src); - - //! Extracts the raw data. + + //! Extracts the raw data. /*! This method saves in \c rawData the data from the sequence of vectors (in private - * attribute \c m_seq) starting at position (\c initialPos,\c paramId) , with a spacing + * attribute \c m_seq) starting at position (\c initialPos,\c paramId) , with a spacing * of \c spacing until \c numPos positions have been extracted. */ void extractRawData (unsigned int initialPos, unsigned int spacing, @@ -415,7 +415,7 @@ class SequenceOfVectors : public BaseVectorSequence //! Sequence of vectors. std::vector m_seq; - + #ifdef UQ_CODE_HAS_MONITORS void subMeanMonitorAlloc (unsigned int numberOfMonitorPositions); void subMeanInter0MonitorAlloc (unsigned int numberOfMonitorPositions); @@ -454,7 +454,7 @@ class SequenceOfVectors : public BaseVectorSequence void subMeanInter0MonitorWrite (std::ofstream& ofs); void unifiedMeanMonitorWrite (std::ofstream& ofs); #endif - + #ifdef UQ_CODE_HAS_MONITORS ScalarSequence* m_subMeanMonitorPosSeq; SequenceOfVectors* m_subMeanVecSeq; diff --git a/src/basic/inc/SequenceStatisticalOptions.h b/src/basic/inc/SequenceStatisticalOptions.h index e91e06f8d..b8fee484a 100644 --- a/src/basic/inc/SequenceStatisticalOptions.h +++ b/src/basic/inc/SequenceStatisticalOptions.h @@ -79,10 +79,10 @@ /*!\file uqSequenceStatisticalOptions.h * \brief A templated class that stores default statistical options - * + * * \class SsOptionsValues * \brief A templated class that stores default statistical options for a sequence of vectors, e.g. - * a Markov chain, a Monte Carlo input sequence, or a Monte Carlo output sequence. + * a Markov chain, a Monte Carlo input sequence, or a Monte Carlo output sequence. */ @@ -90,64 +90,64 @@ class SsOptionsValues { public: //! @name Constructor/Destructor methods - //@{ - //! Default constructor. + //@{ + //! Default constructor. /*! It assigns to the variables the pre-defined options for a sequence of data (scalars; vectors).*/ SsOptionsValues (); - - //! Copy constructor. - /*! It assigns to \c this' variables, the same values of the variable of \c src.*/ + + //! Copy constructor. + /*! It assigns to \c this' variables, the same values of the variable of \c src.*/ SsOptionsValues (const SsOptionsValues& src); - + //! Destructor. ~SsOptionsValues (); //@} - + //! @name Set methods - //@{ - //! Assignment operator; it copies \c rhs to \c this. + //@{ + //! Assignment operator; it copies \c rhs to \c this. SsOptionsValues& operator= (const SsOptionsValues& rhs); //@} //! @name Public attributes - //@{ - + //@{ + //! Stores the initial discarded portion of the chain. std::vector m_initialDiscardedPortions; - + //! Whether or not compute autocorrelation via definition. bool m_autoCorrComputeViaDef; - + //! Whether or not compute autocorrelation via FFT. bool m_autoCorrComputeViaFft; - + //! Second lag of the autocorrelation. unsigned int m_autoCorrSecondLag; - + //! Lag spacing of the autocorrelation. unsigned int m_autoCorrLagSpacing; - + //! Number of lags of the autocorrelation. unsigned int m_autoCorrNumLags; - + //! Whether or not display autocorrelation. bool m_autoCorrDisplay; - + //! Whether or not write autocorrelation to file. bool m_autoCorrWrite; //! Whether or not compute kernel density estimate (kde). bool m_kdeCompute; - + //! Number of positions to evaluate kde. unsigned int m_kdeNumEvalPositions; //! Whether or not compute covariance matrix. bool m_covMatrixCompute; - + //! Whether or not compute correlation matrix. bool m_corrMatrixCompute; - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS unsigned int m_meanMonitorPeriod; @@ -188,7 +188,7 @@ class SsOptionsValues bool m_cdfStaccCompute; unsigned int m_cdfStaccNumEvalPositions; #endif - //@} + //@} // end public attributes private: //! Copies the option values from \c src to \c this. @@ -201,7 +201,7 @@ class SsOptionsValues * \brief A templated class that stores statistical options (optionally read from an input file) * * A templated class that stores statistical options for a sequence of vectors, e.g. - * a Markov chain, a Monte Carlo input sequence, or a Monte Carlo output sequence. + * a Markov chain, a Monte Carlo input sequence, or a Monte Carlo output sequence. */ @@ -209,13 +209,13 @@ class SequenceStatisticalOptions { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Constructor: reads options from the input file. - /*! It assigns to the variables the identifying strings (prefixes) for a sequence of data + /*! It assigns to the variables the identifying strings (prefixes) for a sequence of data * (scalars; vectors) which had been read from an input file.*/ SequenceStatisticalOptions(const BaseEnvironment& env, const std::string& prefix); - + //! Constructor: with alternative option values. /*! In this constructor, the input options are given by \c alternativeOptionsValues, thus, they * are not read from an input file.*/ @@ -228,55 +228,55 @@ class SequenceStatisticalOptions //! @name Statistical methods //@{ - + //! Finds the initially discarded portion of the chain. Access to private attribute m_initialDiscardedPortions const std::vector& initialDiscardedPortions() const; - + //! Compute autocorrelation via definition. Access to private attribute m_autoCorrComputeViaDef bool autoCorrComputeViaDef() const; - + //! Compute autocorrelation via FFT. Access to private attribute m_autoCorrComputeViaFft bool autoCorrComputeViaFft() const; - + //! Returns the second lag of the autocorrelation. Access to private attribute m_autoCorrSecondLag unsigned int autoCorrSecondLag () const; - + //! Returns the spacing of the autocorrelation. Access to private attribute m_autoCorrLagSpacing unsigned int autoCorrLagSpacing () const; - + //! Returns the number of lags of the autocorrelation. Access to private attribute m_autoCorrNumLags unsigned int autoCorrNumLags () const; - + //! Displays autocorrelation. Access to private attribute m_autoCorrDisplay bool autoCorrDisplay () const; - + //! Writes autocorrelation. Access to private attribute m_autoCorrWrite bool autoCorrWrite () const; - + //! Computes KDE. Access to private attribute m_kdeCompute bool kdeCompute () const; - + //! Returns number of evaluation positions for KDE. Access to private attribute m_kdeNumEvalPositions unsigned int kdeNumEvalPositions() const; - + //! Finds the covariance matrix. Access to private attribute m_covMatrixCompute bool covMatrixCompute () const; - + //! Finds the correlation matrix. Access to private attribute m_corrMatrixCompute bool corrMatrixCompute() const; //@} - + //! @name I/O method - //@{ - //! Prints the initial discarded portion of the chain; and, optionally, other attributes of the chain. + //@{ + //! Prints the initial discarded portion of the chain; and, optionally, other attributes of the chain. void print(std::ostream& os) const; //@} - + //! @name Public attribute - //@{ + //@{ SsOptionsValues m_ov; //@} - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS unsigned int meanMonitorPeriod() const; @@ -318,11 +318,11 @@ class SequenceStatisticalOptions bool cdfStaccCompute () const; unsigned int cdfStaccNumEvalPositions() const; #endif - + private: //! Defines the options for the chain void defineMyOptions (po::options_description& optionsDesc) const; - + //! Reads the chain options void getMyOptionValues(po::options_description& optionsDesc); @@ -332,7 +332,7 @@ class SequenceStatisticalOptions std::string m_option_help; std::string m_option_initialDiscardedPortions; - + std::string m_option_autoCorr_computeViaDef; std::string m_option_autoCorr_computeViaFft; std::string m_option_autoCorr_secondLag; @@ -344,7 +344,7 @@ class SequenceStatisticalOptions std::string m_option_kde_numEvalPositions; std::string m_option_covMatrix_compute; std::string m_option_corrMatrix_compute; - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS std::string m_option_mean_monitorPeriod; std::string m_option_bmm_run; @@ -376,8 +376,8 @@ class SequenceStatisticalOptions std::string m_option_hist_numInternalBins; std::string m_option_cdfStacc_compute; std::string m_option_cdfStacc_numEvalPositions; -#endif - +#endif + }; std::ostream& operator<<(std::ostream& os, const SequenceStatisticalOptions& obj); diff --git a/src/basic/inc/VectorFunction.h b/src/basic/inc/VectorFunction.h index 09f022032..c62fa2a2e 100644 --- a/src/basic/inc/VectorFunction.h +++ b/src/basic/inc/VectorFunction.h @@ -37,55 +37,55 @@ namespace QUESO { /*! \file uqVectorFunction.h * \brief Set of classes for handling vector functions. - * + * * \class BaseVectorFunction * \brief A templated (base) class for handling vector functions. * * This class allows the mathematical definition of a vector function such as: - * \f$ \mathbf{q}: B \subset R^n \rightarrow R^m \f$. It requires the specification + * \f$ \mathbf{q}: B \subset R^n \rightarrow R^m \f$. It requires the specification * of the domain \f$ B \f$, which is a subset of the vector space (set) \f$ R^n \f$, - * (and have already been introduced by the class VectorSet) and of the + * (and have already been introduced by the class VectorSet) and of the * image set \f$ R^m \f$.*/ template class BaseVectorFunction { public: //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default Constructor /*! Instantiates an object of the class, i.e. a vector function, given a prefix, its domain and image.*/ BaseVectorFunction(const char* prefix, const VectorSet& domainSet, const VectorSet& imageSet); - //! Destructor + //! Destructor virtual ~BaseVectorFunction(); //@} - + //! @name Mathematical methods. - //@{ - //! Access to the protected attribute \c m_domainSet: domain set of the vector function. It is an instance of the class VectorSet. - /*! This is one example of the advantage of how QUESO represents mathematical + //@{ + //! Access to the protected attribute \c m_domainSet: domain set of the vector function. It is an instance of the class VectorSet. + /*! This is one example of the advantage of how QUESO represents mathematical * identities in a straightforward manner. */ const VectorSet& domainSet() const; - - //! Access to the protected attribute \c m_imageSet: image set of the vector function/ It is an instance of the class VectorSet. + + //! Access to the protected attribute \c m_imageSet: image set of the vector function/ It is an instance of the class VectorSet. const VectorSet& imageSet () const; - + //! Computes the image vector. See template specialization. virtual void compute (const P_V& domainVector, const P_V* domainDirection, Q_V& imageVector, DistArray* gradVectors, // Yes, 'P_V' - DistArray* hessianMatrices, // Yes, 'P_M' + DistArray* hessianMatrices, // Yes, 'P_M' DistArray* hessianEffects) const = 0; //@} protected: const BaseEnvironment& m_env; std::string m_prefix; - - //! Domain set of the vector function. + + //! Domain set of the vector function. const VectorSet& m_domainSet; - + //! Image set of the vector function. const VectorSet& m_imageSet; }; diff --git a/src/basic/inc/VectorFunctionSynchronizer.h b/src/basic/inc/VectorFunctionSynchronizer.h index 455f2dfad..5c4f4d448 100644 --- a/src/basic/inc/VectorFunctionSynchronizer.h +++ b/src/basic/inc/VectorFunctionSynchronizer.h @@ -31,12 +31,12 @@ namespace QUESO { /*! \file VectorFunctionSynchronizer.h * \brief Class for synchronizing the calls of vector-valued functions - * + * * \class VectorFunctionSynchronizer * \brief A templated class for synchronizing the calls of vector-valued functions. * - * This class creates a synchronization point among processes which call vector-valued - * functions. This means that all processes must reach a point in their code before they + * This class creates a synchronization point among processes which call vector-valued + * functions. This means that all processes must reach a point in their code before they * can all begin executing again. */ template @@ -44,7 +44,7 @@ class VectorFunctionSynchronizer { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. VectorFunctionSynchronizer(const BaseVectorFunction& inputFunction, const P_V& auxPVec, @@ -52,17 +52,17 @@ class VectorFunctionSynchronizer //! Destructor ~VectorFunctionSynchronizer(); //@} - + //! @name Mathematical methods - //@{ + //@{ //! Access to the domain set of the vector-valued function which will be synchronized. const VectorSet& domainSet() const; //@} - + //! @name Sync method - //@{ + //@{ //! Calls the vector-valued function which will be synchronized. - /*! This procedure forms a barrier, and no processes in the communicator can pass the + /*! This procedure forms a barrier, and no processes in the communicator can pass the * barrier until all of them call the function. */ void callFunction(const P_V* vecValues, const P_V* vecDirection, diff --git a/src/basic/inc/VectorSequence.h b/src/basic/inc/VectorSequence.h index 9040ccd65..9833c8110 100644 --- a/src/basic/inc/VectorSequence.h +++ b/src/basic/inc/VectorSequence.h @@ -1,6 +1,6 @@ //-----------------------------------------------------------------------Bl- //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -17,7 +17,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- @@ -41,12 +41,12 @@ namespace QUESO { /*! \file VectorSequence.h * \brief A templated class for handling vector and arrays samples - * + * * \class BaseVectorSequence * \brief Base class for handling vector and array samples (sequence of vectors or arrays). * - * This class handles either vector or array samples generated by an algorithm, as well - * as operations that can be carried over them, e.g., calculation of means, correlation + * This class handles either vector or array samples generated by an algorithm, as well + * as operations that can be carried over them, e.g., calculation of means, correlation * and covariance matrices. */ @@ -55,7 +55,7 @@ class BaseVectorSequence { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. BaseVectorSequence(const VectorSpace& vectorSpace, unsigned int subSequenceSize, @@ -63,76 +63,76 @@ class BaseVectorSequence //! Destructor. virtual ~BaseVectorSequence(); //@} - + //! @name Sequence methods - //@{ + //@{ //! Size of the sub-sequence of vectors. See template specialization. virtual unsigned int subSequenceSize () const = 0; - + //! Calculates the size of the unified sequence of vectors. /*! TODO: this procedure does not support parallel vectors yet.*/ unsigned int unifiedSequenceSize () const; - + //! Local dimension (size) of the vector space. unsigned int vectorSizeLocal () const; - + //! Global dimension (size) of the vector space. unsigned int vectorSizeGlobal () const; - + //! Vector space; access to protected attribute VectorSpace& m_vectorSpace. const VectorSpace& vectorSpace () const; - + //! Access to protected attribute \c m_name: name of the sequence of vectors. - /*! This method is used, for instance, to recover the name of a sequence of vector samples, + /*! This method is used, for instance, to recover the name of a sequence of vector samples, * such as the 'rawChain' for the raw chain of samples used in an Monte Carlo algorithm. */ const std::string& name () const; - + //! Changes the name of the sequence of vectors. void setName (const std::string& newName); - + //! Reset the values and the size of the sequence of vectors. void clear (); - + //! Finds the minimum value of the sub-sequence. const V& subMinPlain () const; - + //! Finds the minimum value of the unified sequence. const V& unifiedMinPlain () const; - + //! Finds the maximum value of the sub-sequence. const V& subMaxPlain () const; - + //! Finds the maximum value of the unified sequence. const V& unifiedMaxPlain () const; - + //! Finds the mean value of the sub-sequence. const V& subMeanPlain () const; - + //! Finds the mean value of the unified sequence. const V& unifiedMeanPlain () const; - + //! Finds the median value of the sub-sequence. const V& subMedianPlain () const; - + //! Finds the median value of the unified sequence. const V& unifiedMedianPlain () const; - + //! Finds the variance of a sample of the sub-sequence. const V& subSampleVariancePlain () const; - + //! Finds the variance of a sample of the unified sequence. const V& unifiedSampleVariancePlain () const; - + //! Finds a box subset of the sub-sequence (given by its min and max values calculated via subMinPlain and subMaxPlain). const BoxSubset& subBoxPlain () const; - + //! Finds a box subset of the unified-sequence (given by the min and max values of the unified sequence calculated via unifiedMinPlain and unifiedMaxPlain). const BoxSubset& unifiedBoxPlain () const; - + //! Deletes all the stored vectors. - /*! It deletes all stored vectors and assigns NULL value to the pointers: m_subMinPlain, - * m_unifiedMinPlain, m_subMaxPlain, m_unifiedMaxPlain, m_subMeanPlain, m_unifiedMeanPlain, - * m_subMedianPlain, m_unifiedMedianPlain, m_subBoxPlain, m_unifiedBoxPlain, + /*! It deletes all stored vectors and assigns NULL value to the pointers: m_subMinPlain, + * m_unifiedMinPlain, m_subMaxPlain, m_unifiedMaxPlain, m_subMeanPlain, m_unifiedMeanPlain, + * m_subMedianPlain, m_unifiedMedianPlain, m_subBoxPlain, m_unifiedBoxPlain, * m_subSampleVariancePlain, m_unifiedSampleVariancePlain. */ void deleteStoredVectors (); @@ -140,11 +140,11 @@ class BaseVectorSequence /*! This routine deletes all stored computed vectors */ void append (const BaseVectorSequence& src, unsigned int initialPos, - unsigned int numPos); + unsigned int numPos); //! Finds the positions where the maximum element occurs in the sub-sequence. double subPositionsOfMaximum (const ScalarSequence& subCorrespondingScalarValues, BaseVectorSequence& subPositionsOfMaximum); - + //! Finds the positions where the maximum element occurs in the unified sequence. /*! * \param this The underlying sequence of vectors @@ -158,41 +158,41 @@ class BaseVectorSequence */ double unifiedPositionsOfMaximum (const ScalarSequence& subCorrespondingScalarValues, BaseVectorSequence& unifiedPositionsOfMaximum); - - + + //! Resize the sequence. See template specialization. /*! This routine deletes all stored computed vectors */ - virtual void resizeSequence (unsigned int newSubSequenceSize) = 0; - + virtual void resizeSequence (unsigned int newSubSequenceSize) = 0; + //! Reset the values of the sequence. See template specialization. /*! This routine deletes all stored computed vectors */ virtual void resetValues (unsigned int initialPos, unsigned int numPos) = 0; - + //! Erase \c numPos positions in the sequence, starting at position \c initialPos. /*! This routine deletes all stored computed vectors */ - virtual void erasePositions (unsigned int initialPos, unsigned int numPos) = 0; - - + virtual void erasePositions (unsigned int initialPos, unsigned int numPos) = 0; + + //! Gets the values of the sequence at position \c posId and stores them at \c vec. See template specialization. virtual void getPositionValues (unsigned int posId, V& vec) const = 0; - + //! Set the values in \c vec at position \c posId of the sequence. See template specialization. /*! This routine deletes all stored computed vectors */ virtual void setPositionValues (unsigned int posId, const V& vec) = 0; - + //! Sets the values of the sequence as a Gaussian distribution of mean given by \c meanVec and standard deviation by \c stdDevVec. /*! This routine deletes all stored computed vectors */ void setGaussian (const V& meanVec, const V& stdDevVec); - + //! Sets the values of the sequence as a uniform distribution between the values given by vectors \c aVec and \c bVec. /*! This routine deletes all stored computed vectors */ - void setUniform (const V& aVec, const V& bVec ); + void setUniform (const V& aVec, const V& bVec ); //! Finds the mean value of the sub-sequence, considering \c numPos positions starting at position \c initialPos. See template specialization. virtual void subMeanExtra (unsigned int initialPos, unsigned int numPos, V& meanVec) const = 0; - + //! Finds the mean value of the unified sequence of \c numPos positions starting at position \c initialPos. See template specialization. virtual void unifiedMeanExtra (unsigned int initialPos, unsigned int numPos, @@ -227,10 +227,10 @@ class BaseVectorSequence V& unifiedPopVec) const = 0; //! Calculates the autocovariance. See template specialization. - /*! The autocovariance is the covariance of a variable with itself at some other time. It is - * calculated over a sequence of vectors with initial position \c initialPos, considering + /*! The autocovariance is the covariance of a variable with itself at some other time. It is + * calculated over a sequence of vectors with initial position \c initialPos, considering * \c numPos positions, a lag of \c lag, with mean given by \c meanVec. The results are saved - * in the output vector \c covVec/ */ + * in the output vector \c covVec/ */ virtual void autoCovariance (unsigned int initialPos, unsigned int numPos, const V& meanVec, @@ -252,22 +252,22 @@ class BaseVectorSequence unsigned int numSum, V& autoCorrsSumVec) const = 0; - - //! Finds the minimum and the maximum values of the sub-sequence, considering \c numPos positions starting at position \c initialPos. See template specialization. + + //! Finds the minimum and the maximum values of the sub-sequence, considering \c numPos positions starting at position \c initialPos. See template specialization. virtual void subMinMaxExtra (unsigned int initialPos, unsigned int numPos, V& minVec, V& maxVec) const = 0; - //! Finds the minimum and the maximum values of the unified sequence, considering \c numPos positions starting at position \c initialPos. See template specialization. + //! Finds the minimum and the maximum values of the unified sequence, considering \c numPos positions starting at position \c initialPos. See template specialization. virtual void unifiedMinMaxExtra (unsigned int initialPos, unsigned int numPos, V& unifiedMinVec, V& unifiedMaxVec) const = 0; //! Calculates the histogram of the sub-sequence. See template specialization. /*! The IQR is a robust estimate of the spread of the data, since changes in the upper and - * lower 25% of the data do not affect it. If there are outliers in the data, then the IQR - * is more representative than the standard deviation as an estimate of the spread of the - * body of the data. The IQR is less efficient than the standard deviation as an estimate + * lower 25% of the data do not affect it. If there are outliers in the data, then the IQR + * is more representative than the standard deviation as an estimate of the spread of the + * body of the data. The IQR is less efficient than the standard deviation as an estimate * of the spread when the data is all from the normal distribution. (from Matlab)*/ virtual void subHistogram (unsigned int initialPos, const V& minVec, @@ -289,14 +289,14 @@ class BaseVectorSequence V& unifiedIqrVec) const = 0; //! Selects the scales (bandwidth, \c scaleVec) for the kernel density estimation, considering only the sub-sequence. See template specialization. - /*! The bandwidth of the kernel is a free parameter which exhibits a strong influence on the + /*! The bandwidth of the kernel is a free parameter which exhibits a strong influence on the * resulting estimate. Silverman (1986) suggests the following normal-based estimates: * S1 = 1.06 Ɨ (standard deviation) Ɨ n^{-1/5} * S2 = 0.79 Ɨ (\c iqrVec) Ɨ n^{-1/5}, where \c iqrVec is the interquartile range * \c scaleVec = 0.90 Ɨ minimum(standard deviation, \c iqrVec /1.34) Ɨ n^{-1/5}. * These estimates are popular due to their simplicity, and are used in QUESO with the adaptation * of the exponent oven the sample size n (-1/5) with -1/(4 + \c kdeDimension) where \c kdeDimension - * is the KDE dimension. */ + * is the KDE dimension. */ virtual void subScalesForKde (unsigned int initialPos, const V& iqrVec, unsigned int kdeDimension, @@ -308,9 +308,9 @@ class BaseVectorSequence V& unifiedScaleVec) const = 0; //! Gaussian kernel for the KDE estimate of the sub-sequence. See template specialization. /*! Computes a probability density estimate of the sample in \c this sub-sequence, starting - * at position \c initialPos. \c densityVecs is the vector of density values evaluated at - * the points in \c evaluationParamVecs. The estimate is based on Gaussian (normal) kernel - * function, using a window parameter (\c scaleVec).*/ + * at position \c initialPos. \c densityVecs is the vector of density values evaluated at + * the points in \c evaluationParamVecs. The estimate is based on Gaussian (normal) kernel + * function, using a window parameter (\c scaleVec).*/ virtual void subGaussian1dKde (unsigned int initialPos, const V& scaleVec, const std::vector& evaluationParamVecs, @@ -340,8 +340,8 @@ class BaseVectorSequence const unsigned int subSequenceSize) = 0; //! Select positions in the sequence of vectors. See template specialization. virtual void select (const std::vector& idsOfUniquePositions) = 0; - - //! Filters positions in the sequence of vectors, starting at \c initialPos, and with spacing given by \c spacing. See template specialization. + + //! Filters positions in the sequence of vectors, starting at \c initialPos, and with spacing given by \c spacing. See template specialization. virtual void filter (unsigned int initialPos, unsigned int spacing) = 0; //! Computes the filtering parameters \c spacing for the sequence of vectors. @@ -357,7 +357,7 @@ class BaseVectorSequence unsigned int numPos, unsigned int paramId, ScalarSequence& scalarSeq) const = 0; - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS virtual void subUniformlySampledCdf (const V& numEvaluationPointsVec, ArrayOfOneDGrids & cdfGrids, @@ -391,7 +391,7 @@ class BaseVectorSequence virtual void subCdfStacc (unsigned int initialPos, const std::vector& evalPositionsVecs, std::vector& cdfStaccVecs) const = 0; #endif //QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS - + #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS void computeHistCdfstaccKde (const SequenceStatisticalOptions& statisticalOptions, std::ofstream* passedOfs); @@ -399,21 +399,21 @@ class BaseVectorSequence void computeStatistics (const SequenceStatisticalOptions& statisticalOptions, std::ofstream* passedOfs); #endif //QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS - + #ifdef UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE virtual void subUniformlySampledMdf (const V& numEvaluationPointsVec, ArrayOfOneDGrids & mdfGrids, ArrayOfOneDTables& mdfValues) const = 0; #endif //UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE - + //@} protected: //! Copies vector sequence \c src to \c this. /*! This routine deletes all stored computed vectors */ - void copy (const BaseVectorSequence& src); - - //! Extracts the raw data. See template specialization. + void copy (const BaseVectorSequence& src); + + //! Extracts the raw data. See template specialization. virtual void extractRawData (unsigned int initialPos, unsigned int spacing, unsigned int numPos, @@ -437,8 +437,8 @@ class BaseVectorSequence mutable V* m_unifiedSampleVariancePlain; mutable BoxSubset* m_subBoxPlain; mutable BoxSubset* m_unifiedBoxPlain; - - + + #ifdef UQ_CODE_HAS_MONITORS virtual void subMeanMonitorAlloc (unsigned int numberOfMonitorPositions) = 0; virtual void subMeanInter0MonitorAlloc (unsigned int numberOfMonitorPositions) = 0; @@ -484,7 +484,7 @@ class BaseVectorSequence void computeMeanEvolution (const SequenceStatisticalOptions& statisticalOptions, std::ofstream* passedOfs); #endif - + #ifdef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS void computeBMM (const SequenceStatisticalOptions& statisticalOptions, const std::vector& initialPosForStatistics, @@ -505,7 +505,7 @@ class BaseVectorSequence const std::vector& initialPosForStatistics, std::ofstream* passedOfs); #endif - + #ifdef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS void computeMeanVars (const SequenceStatisticalOptions& statisticalOptions, std::ofstream* passedOfs, @@ -524,7 +524,7 @@ class BaseVectorSequence void computeCovCorrMatrices (const SequenceStatisticalOptions& statisticalOptions, std::ofstream* passedOfs); #endif - + }; // -------------------------------------------------- diff --git a/src/basic/inc/VectorSet.h b/src/basic/inc/VectorSet.h index f801cbea6..82ada0400 100644 --- a/src/basic/inc/VectorSet.h +++ b/src/basic/inc/VectorSet.h @@ -32,13 +32,13 @@ namespace QUESO { /*! \file uqVectorSet.h * \brief A templated class for handling sets. - * + * * \class VectorSet * \brief A templated class for handling sets. * * This class allows the mathematical definition of a scalar function such as: - * \f$ \pi: B \subset R^n \rightarrow R \f$, since it requires the specification - * of the domain \f$ B \f$, which is a subset of the vector space \f$ R^n \f$, + * \f$ \pi: B \subset R^n \rightarrow R \f$, since it requires the specification + * of the domain \f$ B \f$, which is a subset of the vector space \f$ R^n \f$, * which is itself a set.*/ @@ -50,51 +50,51 @@ class VectorSet { public: //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default Constructor /*! It should not be used by the user.*/ VectorSet(); - + //! Shaped constructor. /*! Creates a vector set given an environment, a identifying prefix and a volume.*/ VectorSet(const BaseEnvironment& env, const char* prefix, double volume); - + //! Virtual destructor. virtual ~VectorSet(); //@} - + //! @name Environment methods //@{ //! Environment. Access to private attribute m_env. const BaseEnvironment& env () const; - + //! Access to private attribute m_prefix. const std::string& prefix () const; //@} - + //! @name Mathematical methods. //@{ //! Set volume; access to private attribute m_volume. double volume () const; - + //! Vector space to which \c this set belongs to. See template specialization. virtual const VectorSpace& vectorSpace() const = 0; - + //! Checks whether a set contains vector \c vec. See template specialization. virtual bool contains (const V& vec) const = 0; //@} - + //! @name I/O methods. //@{ //! Prints nothing. - virtual void print (std::ostream& os) const; + virtual void print (std::ostream& os) const; friend std::ostream & operator<<(std::ostream & os, const VectorSet & obj) { obj.print(os); return os; } //@} - + protected: const BaseEnvironment& m_env; std::string m_prefix; diff --git a/src/basic/inc/VectorSpace.h b/src/basic/inc/VectorSpace.h index f69217500..630c8ab2f 100644 --- a/src/basic/inc/VectorSpace.h +++ b/src/basic/inc/VectorSpace.h @@ -36,8 +36,8 @@ namespace QUESO { * \class VectorSpace * \brief A class representing a vector space. * - * Template classes \c V and \c M are to represent a vector class and a matrix class - * respectively. Currently (as of version 0.46.0) QUESO has matrix and vector classes + * Template classes \c V and \c M are to represent a vector class and a matrix class + * respectively. Currently (as of version 0.46.0) QUESO has matrix and vector classes * implemented using either GSL or Trilinos-Teuchos libraries. */ template @@ -56,7 +56,7 @@ class VectorSpace : public VectorSet const char* prefix, unsigned int dimGlobalValue, const std::vector* componentsNamesVec); - + //! Copy constructor. VectorSpace(const VectorSpace& aux); @@ -64,19 +64,19 @@ class VectorSpace : public VectorSet ~VectorSpace(); //@} - + //! @name Attribute methods //@{ //! Environment. const BaseEnvironment& env () const; - + //! Map. const Map& map () const; - + //! Returns total number of processes. unsigned int numOfProcsForStorage () const; - - + + unsigned int dimLocal () const; unsigned int dimGlobal () const; unsigned int globalIdOfFirstComponent() const; @@ -86,25 +86,25 @@ class VectorSpace : public VectorSet //@{ //! Returns a vector filled with zeros const V& zeroVector () const; - + //! Creates an empty vector of size given by Map& map. See template specialization. V* newVector () const; // See template specialization - + //! Creates a vector of size given by Map& map and all values give by \c value. See template specialization V* newVector (double value) const; // See template specialization - + //! Creates vector as a copy of another. V* newVector (const V& v) const; - - //! Creates an empty matrix of size given by Map& map. See template specialization. + + //! Creates an empty matrix of size given by Map& map. See template specialization. M* newMatrix () const; // See template specialization - + //! Creates a diagonal matrix with the elements and size of vector \c v. M* newDiagMatrix (const V& v) const; - - //! Creates a diagonal matrix with the elements \c diagValue and size given by Map& map. See template specialization. + + //! Creates a diagonal matrix with the elements \c diagValue and size given by Map& map. See template specialization. M* newDiagMatrix (double diagValue) const; // See template specialization - + //! Creates a diagonal matrix conditionally to values from vector \c varVec, guaranteeing that its values are neither 0, NAN nor INFINITY. /*! If varVec[i] is either 0, NAN or INFINITY, then this method tries to assign the value (*auxVec)[i])^2 * to matrix(i,i). Case (*auxVec)[i])^2 is either NAN or INFINITY, then matrix(i,i)=1.*/ @@ -112,26 +112,26 @@ class VectorSpace : public VectorSet //! Accessor method to \c this. Vector space to which \c this vector set belongs to. /*! It is virtual in the base class 'VectorSet'*/ - const VectorSpace& vectorSpace () const; // - + const VectorSpace& vectorSpace () const; // + //! Whether \this vector contains vector \c vec. bool contains (const V& vec) const; //! Access to private attribute m_componentsNamesArray, which is an instance of DistArray. const DistArray* componentsNamesArray () const; - + //! Access to private attribute m_componentsNamesVec. const std::vector* componentsNamesVec () const; - + //! Returns the local component names. const std::string& localComponentName (unsigned int localComponentId) const; //@} - + //! @name I/O methods //@{ //! Prints the local component names. void printComponentsNames (std::ostream& os, bool printHorizontally) const; - + //! Prints only a message. void print (std::ostream& os) const; //@} @@ -145,23 +145,23 @@ class VectorSpace : public VectorSet //! Global dimension. unsigned int m_dimGlobal; - + //! Map. const Map* m_map; - + //! Local dimension (number of elements owned by the calling processor.). unsigned int m_dimLocal; - + //! Array of strings of the type DistArray to store the names of the components DistArray* m_componentsNamesArray; - + //! Vector of strings of the type DistArray to store the names of the components DistArray* m_componentsNamesVec; - + //! Empty string for the components names. std::string m_emptyComponentName; - //! A vector of all elements equal to zero. + //! A vector of all elements equal to zero. V* m_zeroVector; }; diff --git a/src/basic/inc/VectorSubset.h b/src/basic/inc/VectorSubset.h index cfb2b4e2e..f531fdb2d 100644 --- a/src/basic/inc/VectorSubset.h +++ b/src/basic/inc/VectorSubset.h @@ -31,7 +31,7 @@ namespace QUESO { /*! \file uqVectorSubset.h * \brief A templated class for handling subsets. - * + * * \class VectorSubset * \brief A templated class for handling subsets. * @@ -45,33 +45,33 @@ class VectorSubset : public VectorSet { public: //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default Constructor /*! It should not be used by the user.*/ VectorSubset(); - + //! Shaped constructor (with volume). VectorSubset(const char* prefix, const VectorSpace& vectorSpace, double volume); - + //! Destructor. virtual ~VectorSubset(); //@} - + //! @name Mathematical methods. //@{ //! Vector space to which \c this set belongs to. See template specialization. const VectorSpace& vectorSpace() const; - + //! Returns whether \c this contains vector \c vec. See template specialization. virtual bool contains (const V& vec) const = 0; //@} - + //! @name I/O methods. //@{ //! Prints nothing. virtual void print (std::ostream& os) const; //@} - + protected: using VectorSet::m_env; using VectorSet::m_prefix; diff --git a/src/basic/src/ArrayOfSequences.C b/src/basic/src/ArrayOfSequences.C index be22a757b..1f77e3a98 100644 --- a/src/basic/src/ArrayOfSequences.C +++ b/src/basic/src/ArrayOfSequences.C @@ -365,7 +365,7 @@ void ArrayOfSequences::autoCorrViaDef(unsigned int initialPos, subChainMean, lag, corrVec); - corrVec /= subChainAutoCovarianceLag0; + corrVec /= subChainAutoCovarianceLag0; return; } diff --git a/src/basic/src/ScalarSequence.C b/src/basic/src/ScalarSequence.C index a2ee431db..49049bb19 100644 --- a/src/basic/src/ScalarSequence.C +++ b/src/basic/src/ScalarSequence.C @@ -2140,7 +2140,7 @@ ScalarSequence::subInterQuantileRange(unsigned int initialPos) const // pos1 = (dataSize+1)/4 - 1 // pos1 >= 0 <==> dataSize >= 3 - // pos1 < (dataSize-1) <==> 3*dataSize > 1 + // pos1 < (dataSize-1) <==> 3*dataSize > 1 unsigned int pos1 = (unsigned int) ( (((double) dataSize) + 1.)*1./4. - 1. ); if (pos1 > (dataSize-1)) { pos1 = 0; @@ -2154,7 +2154,7 @@ ScalarSequence::subInterQuantileRange(unsigned int initialPos) const // pos3 = (dataSize+1)*3/4 - 1 // pos3 >= 0 <==> dataSize >= 1/3 - // pos3 < (dataSize-1) <==> dataSize > 3 + // pos3 < (dataSize-1) <==> dataSize > 3 unsigned int pos3 = (unsigned int) ( (((double) dataSize) + 1.)*3./4. - 1. ); if (pos3 > (dataSize-1)) { pos3 = 0; @@ -2257,7 +2257,7 @@ ScalarSequence::unifiedInterQuantileRange( initialPos, unifiedSortedSequence); unsigned int unifiedDataSize = unifiedSortedSequence.subSequenceSize(); - + unsigned int localDataSize = this->subSequenceSize() - initialPos; unsigned int sumOfLocalSizes = 0; m_env.inter0Comm().Allreduce((void *) &localDataSize, (void *) &sumOfLocalSizes, (int) 1, RawValue_MPI_UNSIGNED, RawValue_MPI_SUM, @@ -2891,7 +2891,7 @@ ScalarSequence::unifiedWriteContents( dataspace, H5P_DEFAULT, // Link creation property list H5P_DEFAULT, // Dataset creation property list - H5P_DEFAULT); // Dataset access property list + H5P_DEFAULT); // Dataset access property list //std::cout << "In ScalarSequence::unifiedWriteContents(): h5 case, data set created" << std::endl; struct timeval timevalBegin; @@ -3185,7 +3185,7 @@ ScalarSequence::unifiedReadContents( if (r == 0) { hid_t dataset = H5Dopen2(unifiedFilePtrSet.h5Var, "seq_of_vectors", - H5P_DEFAULT); // Dataset access property list + H5P_DEFAULT); // Dataset access property list hid_t datatype = H5Dget_type(dataset); H5T_class_t t_class = H5Tget_class(datatype); UQ_FATAL_TEST_MACRO(t_class != H5T_FLOAT, @@ -3513,7 +3513,7 @@ ScalarSequence::parallelMerge( *m_env.subDisplayFile() << "In ScalarSequence::parallelMerge()" << ": tree node " << m_env.inter0Rank() << " is sending " << sortedBuffer.size() - << " doubles to tree node " << parentNode + << " doubles to tree node " << parentNode << ", with sortedBuffer[0] = " << sortedBuffer[0] << " and sortedBuffer[" << sortedBuffer.size()-1 << "] = " << sortedBuffer[sortedBuffer.size()-1] << std::endl; @@ -3932,7 +3932,7 @@ void ScalarSequence::subCdfPercentageRange( unsigned int initialPos, unsigned int numPos, - double range, // \in [0,1] + double range, // \in [0,1] T& lowerValue, T& upperValue) const { @@ -3976,7 +3976,7 @@ ScalarSequence::unifiedCdfPercentageRange( bool useOnlyInter0Comm, unsigned int initialPos, unsigned int numPos, - double range, // \in [0,1] + double range, // \in [0,1] T& unifiedLowerValue, T& unifiedUpperValue) const { @@ -4055,10 +4055,10 @@ ScalarSequence::subCdfStacc( double p = ( ((double) pointId) + 1.0 )/auxNumPoints; double ro0 = p*(1.0-p); cdfStaccValues[pointId] = p; - + //std::cout << "x-data" << data[pointId] - // << std::endl; - + // << std::endl; + for (unsigned int k = 0; k < numPoints; k++) { if (m_seq[k] <= sortedDataValues[pointId]) { Isam_mat[k] = 1; @@ -4066,7 +4066,7 @@ ScalarSequence::subCdfStacc( else { Isam_mat[k] = 0; } - } + } for (unsigned int tau = 0; tau < (numPoints-1); tau++) { ro[tau] = 0.; @@ -4132,7 +4132,7 @@ ScalarSequence::subCdfStacc( "ScalarSequence::subCdfStacc()", "invalid input data"); - // For Joseph: + // For Joseph: // Maybe sort first // For each of the evaluation positions: // --> 1) form temporary scalar seq that contains only 0 and 1 diff --git a/src/basic/src/SequenceOfVectors.C b/src/basic/src/SequenceOfVectors.C index 124df7747..855ebd986 100644 --- a/src/basic/src/SequenceOfVectors.C +++ b/src/basic/src/SequenceOfVectors.C @@ -1485,7 +1485,7 @@ void SequenceOfVectors::unifiedWriteContents( const std::string& fileName, const std::string& inputFileType) const -{ +{ std::string fileType(inputFileType); #ifdef QUESO_HAS_HDF5 // Do nothing @@ -1616,7 +1616,7 @@ SequenceOfVectors::unifiedWriteContents( dataspace, H5P_DEFAULT, // Link creation property list H5P_DEFAULT, // Dataset creation property list - H5P_DEFAULT); // Dataset access property list + H5P_DEFAULT); // Dataset access property list //std::cout << "In SequenceOfVectors::unifiedWriteContents(): h5 case, data set created" << std::endl; struct timeval timevalBegin; @@ -1939,7 +1939,7 @@ SequenceOfVectors::unifiedReadContents( if (r == 0) { hid_t dataset = H5Dopen2(unifiedFilePtrSet.h5Var, "seq_of_vectors", - H5P_DEFAULT); // Dataset access property list + H5P_DEFAULT); // Dataset access property list hid_t datatype = H5Dget_type(dataset); H5T_class_t t_class = H5Tget_class(datatype); UQ_FATAL_TEST_MACRO(t_class != H5T_FLOAT, @@ -2137,8 +2137,8 @@ SequenceOfVectors::estimateConvBrooksGelman( if( m_env.inter0Rank() >= 0 ) { // Sanity Checks - - // REMEMBER: \psi is a *vector* of parameters + + // REMEMBER: \psi is a *vector* of parameters // Get quantities we will use several times V psi_j_dot = m_vectorSpace.zeroVector(); V psi_dot_dot = m_vectorSpace.zeroVector(); @@ -2148,7 +2148,7 @@ SequenceOfVectors::estimateConvBrooksGelman( // n = number of steps for which we are computing the metric int m = m_env.numSubEnvironments(); int n = numPos; - + this->subMeanExtra ( initialPos, numPos, psi_j_dot ); this->unifiedMeanExtra( initialPos, numPos, psi_dot_dot ); @@ -2157,7 +2157,7 @@ SequenceOfVectors::estimateConvBrooksGelman( std::cout << "psi_dot_dot = " << psi_dot_dot << std::endl; #endif - /* W = \frac{1}{m*(n-1)}*\sum_{j=1}^m \sum{t=1}^n + /* W = \frac{1}{m*(n-1)}*\sum_{j=1}^m \sum{t=1}^n (\psi_{jt} - \overline{\psi_{j\cdot}})*(\psi_{jt} - \overline{\psi_{j\cdot}})^T This corresponds to the "within-sequence" covariance matrix. */ M* W_local = m_vectorSpace.newDiagMatrix( m_vectorSpace.zeroVector() ); @@ -2204,12 +2204,12 @@ SequenceOfVectors::estimateConvBrooksGelman( // Need to delete pointers to temporary covariance matrices delete B_over_n_local; - (*B_over_n) = 1.0/(double(m)-1.0) * (*B_over_n); + (*B_over_n) = 1.0/(double(m)-1.0) * (*B_over_n); #if 0 std::cout << "B_over_n = " << *B_over_n << std::endl; #endif - + /* R_p = (n-1)/n + (m+1)/m * \lambda \lambda = largest eigenvalue of W^{-1}*B/n */ @@ -2226,7 +2226,7 @@ SequenceOfVectors::estimateConvBrooksGelman( delete B_over_n; double eigenValue; - V eigenVector = m_vectorSpace.zeroVector(); + V eigenVector = m_vectorSpace.zeroVector(); A->largestEigen( eigenValue, eigenVector ); @@ -2730,7 +2730,7 @@ SequenceOfVectors::subCdfStacc( unsigned int initialPos, std::vector& cdfStaccVecs, std::vector& cdfStaccVecsUp, - std::vector& cdfStaccVecsLow, + std::vector& cdfStaccVecsLow, std::vector& sortedDataVecs) const { bool bRC = (initialPos < this->subSequenceSize()); diff --git a/src/basic/src/SequenceStatisticalOptions.C b/src/basic/src/SequenceStatisticalOptions.C index 6971b994b..b9bf01962 100644 --- a/src/basic/src/SequenceStatisticalOptions.C +++ b/src/basic/src/SequenceStatisticalOptions.C @@ -337,7 +337,7 @@ SequenceStatisticalOptions::defineMyOptions( (m_option_psdAtZero_display.c_str(), po::value()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_DISPLAY_ODV ), "display computed psd at frequency zero on screen" ) (m_option_psdAtZero_write.c_str(), po::value()->default_value(UQ_SEQUENCE_PSD_AT_ZERO_WRITE_ODV ), "write computed psd at frequency zero to the output file" ) (m_option_geweke_compute.c_str(), po::value()->default_value(UQ_SEQUENCE_GEWEKE_COMPUTE_ODV ), "compute Geweke coefficients" ) - (m_option_geweke_naRatio.c_str(), po::value()->default_value(UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV ), "ratio NA for Geweke" ) + (m_option_geweke_naRatio.c_str(), po::value()->default_value(UQ_SEQUENCE_GEWEKE_NA_RATIO_ODV ), "ratio NA for Geweke" ) (m_option_geweke_nbRatio.c_str(), po::value()->default_value(UQ_SEQUENCE_GEWEKE_NB_RATIO_ODV ), "ratio NB for Geweke" ) (m_option_geweke_display.c_str(), po::value()->default_value(UQ_SEQUENCE_GEWEKE_DISPLAY_ODV ), "display computed Geweke on screen" ) (m_option_geweke_write.c_str(), po::value()->default_value(UQ_SEQUENCE_GEWEKE_WRITE_ODV ), "write computed Geweke to the output file" ) diff --git a/src/basic/src/VectorSpace.C b/src/basic/src/VectorSpace.C index 66330bfc7..c9387ec5b 100644 --- a/src/basic/src/VectorSpace.C +++ b/src/basic/src/VectorSpace.C @@ -69,7 +69,7 @@ VectorSpace::VectorSpace(const BaseEnvironment& env, const char* prefix, << "\n componentsNamesVec = " << componentsNamesVec << std::endl; } - + if (m_zeroVector->sizeGlobal() != m_dimGlobal) { std::cerr << "In VectorSpace::constructor(1)" << ", with m_prefix = " << m_prefix @@ -318,7 +318,7 @@ template void VectorSpace::printComponentsNames(std::ostream& os, bool printHorizontally) const { - if (printHorizontally) { + if (printHorizontally) { for (unsigned int i = 0; i < this->dimLocal(); ++i) { os << "'" << this->localComponentName(i) << "'" << " "; diff --git a/src/contrib/ANN/ann2fig/ann2fig.cpp b/src/contrib/ANN/ann2fig/ann2fig.cpp index 87d70f363..bb9b9f935 100644 --- a/src/contrib/ANN/ann2fig/ann2fig.cpp +++ b/src/contrib/ANN/ann2fig/ann2fig.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -120,11 +120,11 @@ void set_slice_val(double val) // getArgs - get input arguments // // Syntax: -// ann2fig [-upi scale] [-x low_x] [-y low_y] +// ann2fig [-upi scale] [-x low_x] [-y low_y] // [-sz size] [-dx dim_x] [-dy dim_y] [-sl dim value]* // [-ps pointsize] // file -// +// // where: // -upi scale fig units per inch (default = 1200) // -x low_x x and y offset of upper left corner (inches) @@ -311,7 +311,7 @@ void writeCaption( // write caption text { if (!strcmp(caption, "\0")) return; // null string? int px = (int) TRANS_X(bnd_box.lo); // put .5 in. lower left - int py = (int) (TRANS_Y(bnd_box.lo) + 0.50 * u_per_in); + int py = (int) (TRANS_Y(bnd_box.lo) + 0.50 * u_per_in); ofile << "4 0 -1 0 0 0 20 0.0000 4 255 2000 "; ofile << px << " " << py << " " << caption << "\\001\n"; } @@ -391,7 +391,7 @@ void recReadTree(ANNorthRect &box) ifile >> n_pts; // input number of points // check for overlap - if (dim == 2 || overlap(box)) { + if (dim == 2 || overlap(box)) { for (int i = 0; i < n_pts; i++) { // yes, write the points ifile >> idx; writePoint(pts[idx]); @@ -492,7 +492,7 @@ void readTree(ANNorthRect &bnd_box) // ... (upper end of bounding box) // If the tree is null, then a single line "null" is // output. Otherwise the nodes of the tree are printed -// one per line in preorder. Leaves and splitting nodes +// one per line in preorder. Leaves and splitting nodes // have the following formats: // Leaf node: // leaf ... diff --git a/src/contrib/ANN/include/ANN/ANN.h b/src/contrib/ANN/include/ANN/ANN.h index d0c79dcbe..73479b363 100644 --- a/src/contrib/ANN/include/ANN/ANN.h +++ b/src/contrib/ANN/include/ANN/ANN.h @@ -7,12 +7,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2010 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -165,7 +165,7 @@ typedef double ANNdist; // distance data type // returned as an integer index into this array. To make it // clearer when this is happening, we define the integer type // ANNidx. Indexing starts from 0. -// +// // For fixed-radius near neighbor searching, it is possible that // there are not k nearest neighbors within the search radius. To // indicate this, the algorithm returns ANN_NULL_IDX as its result. @@ -292,10 +292,10 @@ const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue; // we assume that there is an incremental update function DIFF(x,y) // for #, such that if: // -// s = x0 # ... # xi # ... # xk +// s = x0 # ... # xi # ... # xk +// +// then if s' is equal to s but with xi replaced by y, that is, // -// then if s' is equal to s but with xi replaced by y, that is, -// // s' = x0 # ... # y # ... # xk // // then the length of s' can be computed by: @@ -318,7 +318,7 @@ const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue; // POW(v) = v^p POW(v) = |v|^p // ROOT(x) = x^(1/p) ROOT(x) = x^(1/p) // # = + # = + -// DIFF(x,y) = y - x DIFF(x,y) = y - x +// DIFF(x,y) = y - x DIFF(x,y) = y - x // // L_inf: // POW(v) = |v| @@ -373,8 +373,8 @@ const ANNbool ANN_ALLOW_SELF_MATCH = ANNtrue; //---------------------------------------------------------------------- typedef ANNcoord* ANNpoint; // a point -typedef ANNpoint* ANNpointArray; // an array of points -typedef ANNdist* ANNdistArray; // an array of distances +typedef ANNpoint* ANNpointArray; // an array of points +typedef ANNdist* ANNdistArray; // an array of distances typedef ANNidx* ANNidxArray; // an array of point indices //---------------------------------------------------------------------- @@ -413,7 +413,7 @@ typedef ANNidx* ANNidxArray; // an array of point indices // the new point. It returns a pointer to the newly // allocated copy. //---------------------------------------------------------------------- - + DLL_API ANNdist annDist( int dim, // dimension of space ANNpoint p, // points @@ -429,7 +429,7 @@ DLL_API ANNpointArray annAllocPts( DLL_API void annDeallocPt( ANNpoint &p); // deallocate 1 point - + DLL_API void annDeallocPts( ANNpointArray &pa); // point array @@ -647,7 +647,7 @@ const int ANN_N_SHRINK_RULES = 4; // number of shrink rules // format that is suitable reading by another program. There is a // "load" constructor, which constructs a tree which is assumed to // have been saved by the Dump() procedure. -// +// // Performance and Structure Statistics: // ------------------------------------- // The procedure getStats() collects statistics information on the @@ -776,10 +776,10 @@ class DLL_API ANNkd_tree: public ANNpointSet { virtual void Dump( // dump entire tree ANNbool with_pts, // print points as well? std::ostream& out); // output stream - + virtual void getStats( // compute tree statistics ANNkdStats& st); // the statistics (modified) -}; +}; //---------------------------------------------------------------------- // Box decomposition tree (bd-tree) diff --git a/src/contrib/ANN/include/ANN/ANNperf.h b/src/contrib/ANN/include/ANN/ANNperf.h index 33fa849ae..7fe742550 100644 --- a/src/contrib/ANN/include/ANN/ANNperf.h +++ b/src/contrib/ANN/include/ANN/ANNperf.h @@ -9,12 +9,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -66,7 +66,7 @@ class ANNkdStats { // stats on kd-tree ANNkdStats() // basic constructor { reset(); } - void merge(const ANNkdStats &st); // merge stats from child + void merge(const ANNkdStats &st); // merge stats from child }; //---------------------------------------------------------------------- @@ -89,11 +89,11 @@ class DLL_API ANNsampStat { double minVal, maxVal; // min and max public : void reset() // reset everything - { + { n = 0; sum = sum2 = 0; minVal = ANN_DBL_MAX; - maxVal = -ANN_DBL_MAX; + maxVal = -ANN_DBL_MAX; } ANNsampStat() { reset(); } // constructor @@ -162,7 +162,7 @@ public : // is the number of points for which distance // calculations are performed. // -// coord_hts The number of times a coordinate of a +// coord_hts The number of times a coordinate of a // data point is accessed. This is generally // less than visit_pts*d if partial distance // calculation is used. This count is low diff --git a/src/contrib/ANN/include/ANN/ANNx.h b/src/contrib/ANN/include/ANN/ANNx.h index 129d53d68..940adc56a 100644 --- a/src/contrib/ANN/include/ANN/ANNx.h +++ b/src/contrib/ANN/include/ANN/ANNx.h @@ -13,12 +13,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2010 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/sample/ann_sample.cpp b/src/contrib/ANN/sample/ann_sample.cpp index 5506376fc..9c4abee00 100644 --- a/src/contrib/ANN/sample/ann_sample.cpp +++ b/src/contrib/ANN/sample/ann_sample.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -31,7 +31,7 @@ using namespace std; // make std:: accessible // // This is a simple sample program for the ANN library. After compiling, // it can be run as follows. -// +// // ann_sample [-d dim] [-max mpts] [-nn k] [-e eps] [-df data] [-qf query] // // where diff --git a/src/contrib/ANN/src/ANN.cpp b/src/contrib/ANN/src/ANN.cpp index ccacc6992..7778d8f90 100644 --- a/src/contrib/ANN/src/ANN.cpp +++ b/src/contrib/ANN/src/ANN.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2010 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -28,7 +28,7 @@ #include // C standard lib defs #include // all ANN includes -#include // ANN performance +#include // ANN performance using namespace std; // make std:: accessible @@ -113,7 +113,7 @@ ANNpoint annAllocPt(int dim, ANNcoord c) // allocate 1 point for (int i = 0; i < dim; i++) p[i] = c; return p; } - + ANNpointArray annAllocPts(int n, int dim) // allocate n pts in dim { ANNpointArray pa = new ANNpoint[n]; // allocate points @@ -129,21 +129,21 @@ void annDeallocPt(ANNpoint &p) // deallocate 1 point delete [] p; p = NULL; } - + void annDeallocPts(ANNpointArray &pa) // deallocate points { delete [] pa[0]; // dealloc coordinate storage delete [] pa; // dealloc points pa = NULL; } - + ANNpoint annCopyPt(int dim, ANNpoint source) // copy point { ANNpoint p = new ANNcoord[dim]; for (int i = 0; i < dim; i++) p[i] = source[i]; return p; } - + // assign one rect to another void annAssignRect(int dim, ANNorthRect &dest, const ANNorthRect &source) { diff --git a/src/contrib/ANN/src/bd_fix_rad_search.cpp b/src/contrib/ANN/src/bd_fix_rad_search.cpp index dea3f6bdf..1cba30d7f 100644 --- a/src/contrib/ANN/src/bd_fix_rad_search.cpp +++ b/src/contrib/ANN/src/bd_fix_rad_search.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/bd_pr_search.cpp b/src/contrib/ANN/src/bd_pr_search.cpp index d16d63294..e14643add 100644 --- a/src/contrib/ANN/src/bd_pr_search.cpp +++ b/src/contrib/ANN/src/bd_pr_search.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/bd_search.cpp b/src/contrib/ANN/src/bd_search.cpp index f057018a2..683e86e39 100644 --- a/src/contrib/ANN/src/bd_search.cpp +++ b/src/contrib/ANN/src/bd_search.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/bd_tree.cpp b/src/contrib/ANN/src/bd_tree.cpp index 0977dea96..9be555a38 100644 --- a/src/contrib/ANN/src/bd_tree.cpp +++ b/src/contrib/ANN/src/bd_tree.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -33,7 +33,7 @@ #include // performance evaluation //---------------------------------------------------------------------- -// Printing a bd-tree +// Printing a bd-tree // These routines print a bd-tree. See the analogous procedure // in kd_tree.cpp for more information. //---------------------------------------------------------------------- @@ -350,16 +350,16 @@ ANNkd_ptr rbd_tree( // recursive construction of bd-tree if (n == 0) // empty leaf node return KD_TRIVIAL; // return (canonical) empty leaf else // construct the node and return - return new ANNkd_leaf(n, pidx); + return new ANNkd_leaf(n, pidx); } - + decomp = selectDecomp( // select decomposition method pa, pidx, // points and indices n, dim, // number of points and dimension bnd_box, // current bounding box splitter, shrink, // splitting/shrinking methods inner_box); // inner box if shrinking (returned) - + if (decomp == SPLIT) { // split selected int cd; // cutting dimension ANNcoord cv; // cutting value @@ -414,4 +414,4 @@ ANNkd_ptr rbd_tree( // recursive construction of bd-tree // return shrinking node return new ANNbd_shrink(n_bnds, bnds, in, out); } -} +} diff --git a/src/contrib/ANN/src/bd_tree.h b/src/contrib/ANN/src/bd_tree.h index 408889a07..a55570aa8 100644 --- a/src/contrib/ANN/src/bd_tree.h +++ b/src/contrib/ANN/src/bd_tree.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -77,9 +77,9 @@ class ANNbd_shrink : public ANNkd_node // splitting node of a kd-tree ~ANNbd_shrink() // destructor { - if (child[ANN_IN]!= NULL && child[ANN_IN]!= KD_TRIVIAL) + if (child[ANN_IN]!= NULL && child[ANN_IN]!= KD_TRIVIAL) delete child[ANN_IN]; - if (child[ANN_OUT]!= NULL&& child[ANN_OUT]!= KD_TRIVIAL) + if (child[ANN_OUT]!= NULL&& child[ANN_OUT]!= KD_TRIVIAL) delete child[ANN_OUT]; if (bnds != NULL) delete [] bnds; // delete bounds diff --git a/src/contrib/ANN/src/brute.cpp b/src/contrib/ANN/src/brute.cpp index d7cba2c7f..2399f008f 100644 --- a/src/contrib/ANN/src/brute.cpp +++ b/src/contrib/ANN/src/brute.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_dump.cpp b/src/contrib/ANN/src/kd_dump.cpp index e7015efe8..f08c9d6d2 100644 --- a/src/contrib/ANN/src/kd_dump.cpp +++ b/src/contrib/ANN/src/kd_dump.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -83,7 +83,7 @@ static ANNkd_ptr annReadTree( // read tree-part of dump file // ... (upper end of bounding box) // If the tree is null, then a single line "null" is // output. Otherwise the nodes of the tree are printed -// one per line in preorder. Leaves and splitting nodes +// one per line in preorder. Leaves and splitting nodes // have the following formats: // Leaf node: // leaf ... diff --git a/src/contrib/ANN/src/kd_fix_rad_search.cpp b/src/contrib/ANN/src/kd_fix_rad_search.cpp index 87eb757d7..4d900ae23 100644 --- a/src/contrib/ANN/src/kd_fix_rad_search.cpp +++ b/src/contrib/ANN/src/kd_fix_rad_search.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_fix_rad_search.h b/src/contrib/ANN/src/kd_fix_rad_search.h index 6b3f5c5c5..b5ed38184 100644 --- a/src/contrib/ANN/src/kd_fix_rad_search.h +++ b/src/contrib/ANN/src/kd_fix_rad_search.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_pr_search.cpp b/src/contrib/ANN/src/kd_pr_search.cpp index edb0479f2..e0f95ffb4 100644 --- a/src/contrib/ANN/src/kd_pr_search.cpp +++ b/src/contrib/ANN/src/kd_pr_search.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_pr_search.h b/src/contrib/ANN/src/kd_pr_search.h index 39e048418..19fdd85b5 100644 --- a/src/contrib/ANN/src/kd_pr_search.h +++ b/src/contrib/ANN/src/kd_pr_search.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_search.cpp b/src/contrib/ANN/src/kd_search.cpp index 5004ef798..d171edffb 100644 --- a/src/contrib/ANN/src/kd_search.cpp +++ b/src/contrib/ANN/src/kd_search.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_search.h b/src/contrib/ANN/src/kd_search.h index 1adcdd400..20d0ce2ee 100644 --- a/src/contrib/ANN/src/kd_search.h +++ b/src/contrib/ANN/src/kd_search.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_split.cpp b/src/contrib/ANN/src/kd_split.cpp index 8d5b3d873..a4a35820e 100644 --- a/src/contrib/ANN/src/kd_split.cpp +++ b/src/contrib/ANN/src/kd_split.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_split.h b/src/contrib/ANN/src/kd_split.h index ef80461ea..7c32f7a63 100644 --- a/src/contrib/ANN/src/kd_split.h +++ b/src/contrib/ANN/src/kd_split.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_tree.cpp b/src/contrib/ANN/src/kd_tree.cpp index 2828fd2cf..fc491159e 100644 --- a/src/contrib/ANN/src/kd_tree.cpp +++ b/src/contrib/ANN/src/kd_tree.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -50,7 +50,7 @@ static int IDX_TRIVIAL[] = {0}; // trivial point index ANNkd_leaf *KD_TRIVIAL = NULL; // trivial leaf node //---------------------------------------------------------------------- -// Printing the kd-tree +// Printing the kd-tree // These routines print a kd-tree in reverse inorder (high then // root then low). (This is so that if you look at the output // from the right side it appear from left to right in standard @@ -130,7 +130,7 @@ void ANNkd_tree::Print( // print entire tree #define MAX(a,b) ((a) > (b) ? (a) : (b)) -void ANNkdStats::merge(const ANNkdStats &st) // merge stats from child +void ANNkdStats::merge(const ANNkdStats &st) // merge stats from child { n_lf += st.n_lf; n_tl += st.n_tl; n_spl += st.n_spl; n_shr += st.n_shr; @@ -295,7 +295,7 @@ ANNkd_tree::ANNkd_tree( // basic constructor // // One of the arguments is a pointer to a splitting routine, // whose prototype is: -// +// // void split( // ANNpointArray pa, // complete point array // ANNidxArray pidx, // point array (permuted on return) @@ -324,7 +324,7 @@ ANNkd_ptr rkd_tree( // recursive construction of kd-tree if (n == 0) // empty leaf node return KD_TRIVIAL; // return (canonical) empty leaf else // construct the node and return - return new ANNkd_leaf(n, pidx); + return new ANNkd_leaf(n, pidx); } else { // n large, make a splitting node int cd; // cutting dimension @@ -355,7 +355,7 @@ ANNkd_ptr rkd_tree( // recursive construction of kd-tree return ptr; // return pointer to this node } -} +} //---------------------------------------------------------------------- // kd-tree constructor diff --git a/src/contrib/ANN/src/kd_tree.h b/src/contrib/ANN/src/kd_tree.h index 81284b6ff..87870879e 100644 --- a/src/contrib/ANN/src/kd_tree.h +++ b/src/contrib/ANN/src/kd_tree.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/kd_util.cpp b/src/contrib/ANN/src/kd_util.cpp index 06d65b835..61de8b5b0 100644 --- a/src/contrib/ANN/src/kd_util.cpp +++ b/src/contrib/ANN/src/kd_util.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -279,7 +279,7 @@ void annMedianSplit( // Split the points in an array about a given plane along a // given cutting dimension. On exit, br1 and br2 are set so // that: -// +// // pa[ 0 ..br1-1] < cv // pa[br1..br2-1] == cv // pa[br2.. n -1] > cv diff --git a/src/contrib/ANN/src/kd_util.h b/src/contrib/ANN/src/kd_util.h index 6b4343048..b946f918c 100644 --- a/src/contrib/ANN/src/kd_util.h +++ b/src/contrib/ANN/src/kd_util.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/perf.cpp b/src/contrib/ANN/src/perf.cpp index 09e2b2667..b4de86b50 100644 --- a/src/contrib/ANN/src/perf.cpp +++ b/src/contrib/ANN/src/perf.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2010 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/pr_queue.h b/src/contrib/ANN/src/pr_queue.h index 3f4b75c87..c95a2a6b1 100644 --- a/src/contrib/ANN/src/pr_queue.h +++ b/src/contrib/ANN/src/pr_queue.h @@ -7,12 +7,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/contrib/ANN/src/pr_queue_k.h b/src/contrib/ANN/src/pr_queue_k.h index c2f01c34a..e8c7c210e 100644 --- a/src/contrib/ANN/src/pr_queue_k.h +++ b/src/contrib/ANN/src/pr_queue_k.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -58,7 +58,7 @@ const PQKinfo PQ_NULL_INFO = ANN_NULL_IDX; // nonexistent info value // are made through standard insertion sort. (This is quite // inefficient, but current applications call for small values // of k and relatively few insertions.) -// +// // Note that the list contains k+1 entries, but the last entry // is used as a simple placeholder and is otherwise ignored. //---------------------------------------------------------------------- @@ -83,16 +83,16 @@ class ANNmin_k { ~ANNmin_k() // destructor { delete [] mk; } - + PQKkey ANNmin_key() // return minimum key { return (n > 0 ? mk[0].key : PQ_NULL_KEY); } - + PQKkey max_key() // return maximum key { return (n == k ? mk[k-1].key : PQ_NULL_KEY); } - + PQKkey ith_smallest_key(int i) // ith smallest key (i in [0..n-1]) { return (i < n ? mk[i].key : PQ_NULL_KEY); } - + PQKinfo ith_smallest_info(int i) // info for ith smallest (i in [0..n-1]) { return (i < n ? mk[i].info : PQ_NULL_INFO); } diff --git a/src/contrib/ANN/test/ann_test.cpp b/src/contrib/ANN/test/ann_test.cpp index 093f5c6a9..22012683e 100644 --- a/src/contrib/ANN/test/ann_test.cpp +++ b/src/contrib/ANN/test/ann_test.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2010 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -66,7 +66,7 @@ using namespace std; // make std:: available // Overview: // --------- // The test program is run as follows: -// +// // ann_test < test_input > test_output // // where the test_input file contains a list of directives as described @@ -1092,7 +1092,7 @@ int main(int argc, char** argv) //------------------------------------------------------------ // Print summaries //------------------------------------------------------------ - + if (stats > SILENT) { cout << "[Run Queries:\n"; cout << " query_size = " << query_size << "\n"; @@ -1309,7 +1309,7 @@ void readPts( char ignore_me; // character for EOF test in_file >> ignore_me; // try to get one more character if (!in_file.eof()) { // exhausted space before eof - if (type == DATA) + if (type == DATA) Error("`data_size' too small. Input file truncated.", ANNwarn); else Error("`query_size' too small. Input file truncated.", ANNwarn); diff --git a/src/contrib/ANN/test/rand.cpp b/src/contrib/ANN/test/rand.cpp index 9bf6204ef..8435c6bf8 100644 --- a/src/contrib/ANN/test/rand.cpp +++ b/src/contrib/ANN/test/rand.cpp @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied @@ -48,7 +48,7 @@ int annIdum = 0; // used for random number generation // William Press, Brian Flannery, Saul Teukolsky, and William // Vetterling. The task of the code is to do an additional randomizing // shuffle on the system-supplied random number generator to make it -// safer to use. +// safer to use. // // Returns a uniform deviate between 0.0 and 1.0 using the // system-supplied routine random() or rand(). Set the global @@ -74,7 +74,7 @@ double annRan0() // first call, even if "annIdum" is not set negative. Determine // "maxran", the next integer after the largest representable value // of type int. We assume this is a factor of 2 smaller than the - // corresponding value of type unsigned int. + // corresponding value of type unsigned int. //-------------------------------------------------------------------- if (annIdum < 0 || iff == 0) { // initialize @@ -146,7 +146,7 @@ static double annRanGauss() //------------------------------------------------------------ // Pick two uniform numbers in the square extending from -1 to // +1 in each direction, see if they are in the circle of radius - // 1. If not, try again + // 1. If not, try again //------------------------------------------------------------ v1 = annRanUnif(-1, 1); v2 = annRanUnif(-1, 1); @@ -170,15 +170,15 @@ static double annRanGauss() //------------------------------------------------------------------------ // annRanLaplace - Laplacian random number generator // Returns a Laplacian distributed deviate with zero mean and -// unit variance, using annRan0() as the source of uniform deviates. +// unit variance, using annRan0() as the source of uniform deviates. // // prob(x) = b/2 * exp(-b * |x|). // // b is chosen to be sqrt(2.0) so that the variance of the Laplacian -// distribution [2/(b^2)] becomes 1. +// distribution [2/(b^2)] becomes 1. //------------------------------------------------------------------------ -static double annRanLaplace() +static double annRanLaplace() { const double b = 1.4142136; @@ -260,7 +260,7 @@ void annCoGaussPts( // correlated-Gaussian distribution for (int d = 1; d < dim; d++) { previous = correlation*previous + std_dev_w*annRanGauss(); pa[i][d] = (ANNcoord) previous; - } + } } } @@ -290,7 +290,7 @@ void annCoLaplacePts( // correlated-Laplacian distribution wn = annRanLaplace(); previous = correlation * previous + wn; pa[i][d] = (ANNcoord) previous; - } + } } } @@ -354,14 +354,14 @@ void annClusGaussPts( // clustered-Gaussian distribution // // This is done as follows. Each cluster is defined by a d-element // control vector whose components are either: -// +// // CO_FLAG indicating that this component is to be generated // uniformly in [-1,1], // x a value other than CO_FLAG in the range [-1,1], // which indicates that this coordinate is to be // generated as x plus a Gaussian random deviation // with the given standard deviation. -// +// // The number of zero components is the dimension of the flat, which // is a random integer in the range from 1 to max_dim. The points // are disributed between clusters in nearly equal sized groups. diff --git a/src/contrib/ANN/test/rand.h b/src/contrib/ANN/test/rand.h index b87cb4185..deba9e9da 100644 --- a/src/contrib/ANN/test/rand.h +++ b/src/contrib/ANN/test/rand.h @@ -6,12 +6,12 @@ //---------------------------------------------------------------------- // Copyright (c) 1997-2005 University of Maryland and Sunil Arya and // David Mount. All Rights Reserved. -// +// // This software and related documentation is part of the Approximate // Nearest Neighbor Library (ANN). This software is provided under // the provisions of the Lesser GNU Public License (LGPL). See the // file ../ReadMe.txt for further information. -// +// // The University of Maryland (U.M.) and the authors make no // representations about the suitability or fitness of this software for // any purpose. It is provided "as is" without express or implied diff --git a/src/core/inc/BasicPdfsBase.h b/src/core/inc/BasicPdfsBase.h index 2ac1edf9d..da29037bd 100644 --- a/src/core/inc/BasicPdfsBase.h +++ b/src/core/inc/BasicPdfsBase.h @@ -35,9 +35,9 @@ namespace QUESO { */ /*! \class BasicPdfsBase - \brief TODO: Base class for basic PDFs (via either GSL or Boost). - - \todo This class \b will acommodate the definition of a Joint PDF using either GSL or Boost + \brief TODO: Base class for basic PDFs (via either GSL or Boost). + + \todo This class \b will acommodate the definition of a Joint PDF using either GSL or Boost distributions. It will ultimately be called by BaseJointPdf and/or its derived classes (via m_env.basicPdfs()) during the construction of Joint PDFs. */ @@ -45,22 +45,22 @@ class BasicPdfsBase { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. BasicPdfsBase(); - + //! Constructor. BasicPdfsBase(int worldRank); - + //! Virtual destructor. virtual ~BasicPdfsBase(); //@} //! @name Mathematical methods - //@{ + //@{ //! TODO: Actual value of the Beta PDF (calculated via either Boost or GSL libraries). See template specialization. virtual double betaPdfActualValue (double x, double alpha, double beta) const = 0; - + //! TODO: Actual value of the Gamma PDF (calculated via either Boost or GSL libraries). See template specialization. virtual double gammaPdfActualValue(double x, double a, double b ) const = 0; //@} diff --git a/src/core/inc/BasicPdfsBoost.h b/src/core/inc/BasicPdfsBoost.h index da5d6373e..1fbc0b865 100644 --- a/src/core/inc/BasicPdfsBoost.h +++ b/src/core/inc/BasicPdfsBoost.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace QUESO { @@ -36,8 +36,8 @@ namespace QUESO { */ /*! \class BasicPdfsBoost - \brief TODO: Base class for basic PDFs using Boost library. - + \brief TODO: Base class for basic PDFs using Boost library. + \todo This class \b will acommodate the definition of a Joint PDF using distributions available in the Boost library. It will ultimately be called by BaseJointPdf and/or its derived classes (via m_env.basicPdfs()) during the construction of Joint PDFs. @@ -46,27 +46,27 @@ class BasicPdfsBoost : public BasicPdfsBase { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. BasicPdfsBoost(); - + //! Constructor. BasicPdfsBoost(int worldRank); - + //! Destructor. ~BasicPdfsBoost(); //@} //! @name Mathematical methods - //@{ + //@{ //! TODO: Actual value of the Beta PDF. double betaPdfActualValue (double x, double alpha, double beta) const; - + //! TODO: Actual value of the Gamma PDF. double gammaPdfActualValue(double x, double a, double b ) const; //@} - -private: + +private: }; } // End namespace QUESO diff --git a/src/core/inc/BasicPdfsGsl.h b/src/core/inc/BasicPdfsGsl.h index 7c72b1c8d..d447b2bd9 100644 --- a/src/core/inc/BasicPdfsGsl.h +++ b/src/core/inc/BasicPdfsGsl.h @@ -34,8 +34,8 @@ namespace QUESO { */ /*! \class BasicPdfsGsl - \brief TODO: Base class for basic PDFs using Gsl library. - + \brief TODO: Base class for basic PDFs using Gsl library. + \todo This class \b will acommodate the definition of a Joint PDF using distributions available in the Gsl library. It will ultimately be called by BaseJointPdf and/or its derived classes (via m_env.basicPdfs()) during the construction of Joint PDFs. @@ -44,10 +44,10 @@ class BasicPdfsGsl : public BasicPdfsBase { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. BasicPdfsGsl(); - + //! Constructor. BasicPdfsGsl(int worldRank); @@ -56,10 +56,10 @@ class BasicPdfsGsl : public BasicPdfsBase //@} //! @name Mathematical methods - //@{ + //@{ //! TODO: Actual value of the Beta PDF. double betaPdfActualValue (double x, double alpha, double beta) const; - + //! TODO: Actual value of the Gamma PDF. double gammaPdfActualValue(double x, double a, double b ) const; //@} diff --git a/src/core/inc/Defines.h b/src/core/inc/Defines.h index 48908402b..3643dce3f 100644 --- a/src/core/inc/Defines.h +++ b/src/core/inc/Defines.h @@ -96,7 +96,7 @@ const int UQ_MATRIX_SVD_FAILED_RC = -11; /*! \class EnvOptionsValues * \brief This class provides a suite options one can pass to a QUESO environment. - * + * * QUESO expects the user to provide an input file with environment options for the library variables. * If no input file, a collection of default values is assigned to some of the variables. The class * EnvOptionsValues is responsible for this task. @@ -106,19 +106,19 @@ class EnvOptionsValues { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor EnvOptionsValues (); - + //! Copy constructor EnvOptionsValues (const EnvOptionsValues& src); - + //! Destructor ~EnvOptionsValues (); //@} - + //! @name Set methods - //@{ + //@{ //! Operator for copying the options of an environment. EnvOptionsValues& operator= (const EnvOptionsValues& rhs); //@} @@ -126,49 +126,49 @@ class EnvOptionsValues //! @name Attributes //! Number of sub-environments. unsigned int m_numSubEnvironments; - + //! Output filename for sub-screen writing. std::string m_subDisplayFileName; - + //! Allows (or not) all sub-environments to write to output file. bool m_subDisplayAllowAll; - + //! Allows (or not) all inter0 nodes to write to output file bool m_subDisplayAllowInter0; - + //! Sub-environments that will write to output. std::set m_subDisplayAllowedSet; - + //! Verbosity. unsigned int m_displayVerbosity; - + //! Synchronized verbosity. unsigned int m_syncVerbosity; - + //! Checking level unsigned int m_checkingLevel; //! Type of the random number generator. std::string m_rngType; - + //! Seed of the random number generator. /*! If env_seed = -z, with z>=1, then each processor sets the seed to value MPI_RANK + z. It is crucial that \verb+env_seed+ takes a \underline{negative} value, otherwise all chain samples are going to be the same.*/ int m_seed; - + //! Platform name. std::string m_platformName; - + //! Identifying string. std::string m_identifyingString; - + //! Number of debug parameters. unsigned int m_numDebugParams; - + //! Debug parameters std::vector m_debugParams; //@} - + private: //! Makes an exact copy of an existing EnvOptionsValues instance. void copy(const EnvOptionsValues& src); diff --git a/src/core/inc/DistArray.h b/src/core/inc/DistArray.h index 45158e2d7..0337686ce 100644 --- a/src/core/inc/DistArray.h +++ b/src/core/inc/DistArray.h @@ -40,14 +40,14 @@ namespace QUESO { /*! \class DistArray \brief A class for partitioning vectors and matrices. - - Class DistArray allows the construction and usage of multi-vectors. - These vectors contain element of type T, and the storage is row-oriented - (instead of and not column-oriented; thus his class should be used as a container - for data, on which no BLAS-like operations are performed). - + + Class DistArray allows the construction and usage of multi-vectors. + These vectors contain element of type T, and the storage is row-oriented + (instead of and not column-oriented; thus his class should be used as a container + for data, on which no BLAS-like operations are performed). + DistArray objects are identified by an Map and a RowSize. The map specifies - the distribution of the elements across the processors and therefore the number + the distribution of the elements across the processors and therefore the number of local elements, while the RowSize gives the total number of data assigned to each node. RowSize is constant for all elements. */ @@ -56,52 +56,52 @@ template class DistArray { public: - + //! @name Constructor/Destructor methods //@{ //! Default constructor. Do not call this directly. DistArray(); - - //! Constructor for a given inputMap and inputRowSize. + + //! Constructor for a given inputMap and inputRowSize. DistArray(const Map& inputMap, const int inputRowSize); - + //! Copy constructor DistArray(const DistArray& src); - + //! Destructor ~DistArray(); //@} - + //! @name Set methods //@{ //! Assignment operator. DistArray& operator= (const DistArray& rhs); //@} - + //! @name Query methods //@{ - - //! Returns a reference to the colId column component of the localElementId local element. + + //! Returns a reference to the colId column component of the localElementId local element. T& operator ()(int localElementId, int colId); - + //! Returns a reference to the colId column component of the localElementId local element.(const) const T& operator ()(int localElementId, int colId) const; - - //! Returns the global length of the array. + + //! Returns the global length of the array. int GlobalLength() const; - - //! Returns the length of the locally owned array. + + //! Returns the length of the locally owned array. int MyLength () const; - - //! Returns the row size, that is, the amount of data associated with each element. + + //! Returns the row size, that is, the amount of data associated with each element. int RowSize () const; - + //@} - + //! @name I/O methods - //@{ + //@{ void print (std::ostream& os) const; friend std::ostream & operator<<(std::ostream& os, const DistArray& obj) { diff --git a/src/core/inc/Environment.h b/src/core/inc/Environment.h index e0384c7f3..d4a9e461b 100644 --- a/src/core/inc/Environment.h +++ b/src/core/inc/Environment.h @@ -50,15 +50,15 @@ namespace QUESO { /*! queso_terminate_handler * \brief Function for unhandled exceptions in Queso * - * This function deals with unhandled exceptions encountered in Queso. - * It provides a call to MPI_abort using the global communicator. + * This function deals with unhandled exceptions encountered in Queso. + * It provides a call to MPI_abort using the global communicator. */ void queso_terminate_handler(); /*! \struct FilePtrSetStruct * \brief Struct for handling data input and output from files. * - * This struct deals with data input and output from files. + * This struct deals with data input and output from files. * It encapsulates the input/output stream class std:: fstream. */ diff --git a/src/core/inc/EnvironmentOptions.h b/src/core/inc/EnvironmentOptions.h index 1fd77792d..25e5fb334 100644 --- a/src/core/inc/EnvironmentOptions.h +++ b/src/core/inc/EnvironmentOptions.h @@ -54,22 +54,22 @@ namespace QUESO { /*! \class EnvironmentOptions * \brief This class reads options one can pass to a QUESO environment through an input file. - * - * QUESO expects the user to provide an input file with environment options for the library variables. + * + * QUESO expects the user to provide an input file with environment options for the library variables. * This class reads the input options for QUESO environment variables. */ - + class EnvironmentOptions { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor /*! Assigns the default suite of options to the environment.*/ EnvironmentOptions(const BaseEnvironment& env, const char* prefix); - + //! Constructor with alternative options values. EnvironmentOptions(const BaseEnvironment& env, const char* prefix, const EnvOptionsValues& alternativeOptionsValues); - + //! Destructor ~EnvironmentOptions(); //@} @@ -78,31 +78,31 @@ class EnvironmentOptions //@{ //! Scans option values from input file. void scanOptionsValues(); - + //! Print values of the options chosen. void print (std::ostream& os) const; //@} - - + + //! Instance of EnvOptionsValues, a class with default values for QUESO environment. EnvOptionsValues m_ov; private: //! Define my environment options as the default options void defineMyOptions (po::options_description& optionsDesc) const; - + //! Gets the option values of the environment. void getMyOptionValues(po::options_description& optionsDesc); //! Environment. const BaseEnvironment& m_env; - + //! Options prefix. std::string m_prefix; - + //! Environment options description. - /*! Uses boost::program_options::options_description. A set of option descriptions. - * This provides convenient interface for adding new option method, and facilities + /*! Uses boost::program_options::options_description. A set of option descriptions. + * This provides convenient interface for adding new option method, and facilities * to search for options by name.*/ po::options_description* m_optionsDesc; @@ -110,39 +110,39 @@ class EnvironmentOptions //! My number of sub-environments. std::string m_option_numSubEnvironments; - + //! My output filename for sub-screen writing. std::string m_option_subDisplayFileName; - + //! Allows (or not) all sub-environments to write to output file. std::string m_option_subDisplayAllowAll; - + //! Allows (or not) all inter0 nodes to write to output file std::string m_option_subDisplayAllowInter0; - + //! Sub-environments that will write to output. std::string m_option_subDisplayAllowedSet; - + //! Verbosity. std::string m_option_displayVerbosity; - + //! Synchronized verbosity. std::string m_option_syncVerbosity; - + //! Checking level std::string m_option_checkingLevel; - + //! Type of the random number generator. std::string m_option_rngType; - + //! Seed of the random number generator. /*! If env_seed = -z, with z>=1, then each processor sets the seed to value MPI_RANK + z. It is crucial that \verb+env_seed+ takes a \underline{negative} value, otherwise all chain samples are going to be the same.*/ std::string m_option_seed; - + //! Platform name. std::string m_option_platformName; - + //! Identifying string. std::string m_option_identifyingString; }; diff --git a/src/core/inc/GslOptimizer.h b/src/core/inc/GslOptimizer.h index c978e908e..a4e9826c1 100644 --- a/src/core/inc/GslOptimizer.h +++ b/src/core/inc/GslOptimizer.h @@ -86,7 +86,7 @@ class GslOptimizer : public BaseOptimizer { * optimization failed */ const GslVector & minimizer() const; - + void set_solver_type( SolverType solver ); void set_solver_type( std::string& solver ); @@ -118,7 +118,7 @@ class GslOptimizer : public BaseOptimizer { private: const BaseScalarFunction & m_objectiveFunction; - + GslVector * m_initialPoint; GslVector * m_minimizer; diff --git a/src/core/inc/GslVector.h b/src/core/inc/GslVector.h index 869987cbb..0b6f634c7 100644 --- a/src/core/inc/GslVector.h +++ b/src/core/inc/GslVector.h @@ -39,23 +39,23 @@ namespace QUESO { /*! \class GslVector \brief Class for vector operations using GSL library. - - This class creates and provides basic support for vectors of templated - type as a specialization of Vector using GSL vectors, which are defined + + This class creates and provides basic support for vectors of templated + type as a specialization of Vector using GSL vectors, which are defined by an encapsulated gsl_vector structure. */ class GslVector : public Vector { public: - + //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default Constructor /*! Creates an empty vector of no length.*/ GslVector(); - + GslVector(const BaseEnvironment& env, const Map& map); GslVector(const BaseEnvironment& env, const Map& map, double value); GslVector(const BaseEnvironment& env, double d1, double d2, const Map& map); // MATLAB linspace @@ -63,125 +63,125 @@ class GslVector : public Vector //! Construct a vector, with length the same as \c v, with evenly spaced numbers from \c start to \c end, inclusive GslVector(const GslVector& v, double start, double end); GslVector(const GslVector& y); - + //! Destructor ~GslVector(); //@} - + //! @name Set methods. - //@{ - //! Copies values from vector rhs to \c this. + //@{ + //! Copies values from vector rhs to \c this. GslVector& operator= (const GslVector& rhs); - + //! Stores in \c this the coordinate-wise multiplication of \c this and a. GslVector& operator*=(double a); - + //! Stores in \c this the coordinate-wise division of \c this by a. GslVector& operator/=(double a); - + //! Stores in \c this the coordinate-wise multiplication of \c this with rhs. GslVector& operator*=(const GslVector& rhs); - + //! Stores in \c this the coordinate-wise division of \c this by rhs. GslVector& operator/=(const GslVector& rhs); - + //! Stores in \c this the coordinate-wise addition of \c this and rhs. GslVector& operator+=(const GslVector& rhs); - + //! Stores in \c this the coordinate-wise subtraction of \c this by rhs. GslVector& operator-=(const GslVector& rhs); //@} - + //! @name Accessor methods. //@{ //! Element access method (non-const). - /*! Returns the i-th element if x[i] is specified, the expression x(i) will return the same element.*/ + /*! Returns the i-th element if x[i] is specified, the expression x(i) will return the same element.*/ double& operator[](unsigned int i); - + //! Element access method (const). - /*! Returns the i-th element if x[i] is specified, the expression x(i) will return the same element.*/ - + /*! Returns the i-th element if x[i] is specified, the expression x(i) will return the same element.*/ + const double& operator[](unsigned int i) const; //@} //! @name Attribute methods. - //@{ + //@{ //! Returns the length of this vector. unsigned int sizeLocal () const; //! Returns the global length of this vector. unsigned int sizeGlobal () const; //@} - + //! @name Mathematical methods. - //@{ + //@{ //! Returns the 2-norm squared of this vector. double norm2Sq () const; - + //! Returns the 2-norm (Euclidean norm) of the vector. double norm2 () const; - + //! Returns the 1-norm of the vector. double norm1 () const; - + //! Returns the infinity-norm (maximum norm) of the vector. double normInf () const; - + //! Returns the sum of the components of the vector. double sumOfComponents () const; //@} - + //! @name Set methods. - //@{ + //@{ //! Component-wise sets all values to \c this with value. void cwSet (double value); - + //! This function sets component-wise Gaussian random variates, with mean mean and standard deviation stdDev. void cwSetGaussian (double mean, double stdDev); - + //! This function sets component-wise Gaussian random variates, with vectors for mean and standard deviation. void cwSetGaussian (const GslVector& meanVec, const GslVector& stdDevVec); - + //! This function sets component-wise a number uniformly distributed in the range of elements of [aVec,bVec]. void cwSetUniform (const GslVector& aVec, const GslVector& bVec); - + //! This function returns a random variate from the beta distribution, with vector parameters alpha and beta. void cwSetBeta (const GslVector& alpha, const GslVector& beta); - - //! This function returns a random variate from the gamma distribution with vector parameters a and b. + + //! This function returns a random variate from the gamma distribution with vector parameters a and b. void cwSetGamma (const GslVector& a, const GslVector& b); - - //! This function returns a random variate from the inverse gamma distribution with vector parameters alpha and beta. + + //! This function returns a random variate from the inverse gamma distribution with vector parameters alpha and beta. void cwSetInverseGamma(const GslVector& alpha, const GslVector& beta); - + //! This function concatenates GslVector v1 and GslVector v2 into \c this. void cwSetConcatenated(const GslVector& v1, const GslVector& v2); - + //! This function concatenates vectors \c v1 and \c v2 into \c this vector. void cwSetConcatenated(const std::vector& vecs); - - //! This function sets the vector vec into \c this starting at position initialPos. + + //! This function sets the vector vec into \c this starting at position initialPos. void cwSet (unsigned int initialPos, const GslVector& vec); - //! This function sets the values of this starting at position initialPos ans saves them in vector vec. + //! This function sets the values of this starting at position initialPos ans saves them in vector vec. void cwExtract (unsigned int initialPos, GslVector& vec) const; - - //! This function inverts component-wise the element values of \c this. + + //! This function inverts component-wise the element values of \c this. void cwInvert (); - - //! This function returns component-wise the square-root of \c this. + + //! This function returns component-wise the square-root of \c this. void cwSqrt (); //@} //! @name I/O methods. - //@{ + //@{ //! Print method. Defines the behavior of the std::ostream << operator inherited from the Object class. void print (std::ostream& os) const; //@} - //! This function sorts the elements of the vector \c this in ascending numerical order. + //! This function sorts the elements of the vector \c this in ascending numerical order. void sort (); - + void matlabDiff (unsigned int firstPositionToStoreDiff, double valueForRemainderPosition, GslVector& outputVec) const; void matlabLinearInterpExtrap(const GslVector& x1Vec, const GslVector& y1Vec, const GslVector& x2Vec); void mpiBcast (int srcRank, const MpiComm& bcastComm); @@ -196,40 +196,40 @@ class GslVector : public Vector const std::set& allowedSubEnvIds); //! @name Comparison methods. - //@{ + //@{ //! This function returns true if at least one component of \c this is smaller than the respective component of rhs. bool atLeastOneComponentSmallerThan (const GslVector& rhs) const; - - //! This function returns true if at least one component of \c this is bigger than the respective component of rhs. + + //! This function returns true if at least one component of \c this is bigger than the respective component of rhs. bool atLeastOneComponentBiggerThan (const GslVector& rhs) const; - + //! This function returns true if at least one component of \c this is smaller than or equal to the respective component of rhs. bool atLeastOneComponentSmallerOrEqualThan(const GslVector& rhs) const; - - //! This function returns true if at least one component of \c this is bigger than or equal to the respective component of rhs. + + //! This function returns true if at least one component of \c this is bigger than or equal to the respective component of rhs. bool atLeastOneComponentBiggerOrEqualThan (const GslVector& rhs) const; //@} // Necessary for GslMatrix::invertMultiply() and GslMatrix::setRow/Column - gsl_vector* data () const; + gsl_vector* data () const; //! @name Attribute methods. - //@{ + //@{ //! Returns the maximum value in the vector \c this. double getMaxValue () const; - + //! Returns minimum value in the vector \c this. double getMinValue () const; - + //! This function returns the index of the maximum value in the vector \c this. int getMaxValueIndex () const; - + //! This function returns the index of the minimum value in the vector \c this. int getMinValueIndex () const; - + //! This function returns maximum value in the vector \c this and its the index. void getMaxValueAndIndex( double& value, int& index ); - + //! This function returns minimum value in the vector \c this and its the index. void getMinValueAndIndex( double& value, int& index ); diff --git a/src/core/inc/InfiniteDimensionalLikelihoodBase.h b/src/core/inc/InfiniteDimensionalLikelihoodBase.h index 703a6ee34..8308a6b7e 100644 --- a/src/core/inc/InfiniteDimensionalLikelihoodBase.h +++ b/src/core/inc/InfiniteDimensionalLikelihoodBase.h @@ -1,5 +1,5 @@ //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- diff --git a/src/core/inc/InfiniteDimensionalMCMCSamplerOptions.h b/src/core/inc/InfiniteDimensionalMCMCSamplerOptions.h index 7fcd5397f..ece3419bd 100644 --- a/src/core/inc/InfiniteDimensionalMCMCSamplerOptions.h +++ b/src/core/inc/InfiniteDimensionalMCMCSamplerOptions.h @@ -1,5 +1,5 @@ //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- diff --git a/src/core/inc/Map.h b/src/core/inc/Map.h index 54e05a1cd..f637267d1 100644 --- a/src/core/inc/Map.h +++ b/src/core/inc/Map.h @@ -40,9 +40,9 @@ namespace QUESO { /*! \class Map \brief A class for partitioning vectors and matrices. - - It is often the case that multiple matrix and vector objects have an identical distribution - of elements on a parallel machine. The Map keeps information that describes this + + It is often the case that multiple matrix and vector objects have an identical distribution + of elements on a parallel machine. The Map keeps information that describes this distribution for matrices and vectors. Inspired by Trilinos Epetra_Map class. */ @@ -54,12 +54,12 @@ class Map //! Default constructor. Do not call this directly. Map(); - - //! Constructor for a uniform linear distribution of elements. + + //! Constructor for a uniform linear distribution of elements. Map(int numGlobalElements, int indexBase, const MpiComm& comm); - + //! Copy constructor. Map(const Map& src); @@ -69,32 +69,32 @@ class Map //! @name Set methods //@{ - //! Assignment operator. + //! Assignment operator. Map& operator= (const Map& rhs); //@} - + //! @name Size, dimension and local ID accessor methods //@{ //! Returns the total number of elements across all processors. int NumGlobalElements() const; - - //! Returns the base integer value for indexed array references. + + //! Returns the base integer value for indexed array references. //! The first position in the global processor in my processors. int IndexBase () const;//1st position in the global processor in my processors - + //! Returns the number of elements owned by the calling processor. int NumMyElements () const; //!The minimum global index value on the calling processor. int MinMyGID () const; - //@} - + //@} + //! @name Miscellaneous methods //@{ - //! Access function for MpiComm communicator. + //! Access function for MpiComm communicator. const MpiComm& Comm () const; - + #ifdef QUESO_HAS_TRILINOS //! Trilinos Epetra_Map: A class for partitioning vectors and matrices. const Epetra_Map& epetraMap () const; @@ -105,19 +105,19 @@ class Map //! Copies the map. void copy (const Map& src); - //! This communicator can be queried for processor rank and size information. + //! This communicator can be queried for processor rank and size information. MpiComm m_MpiComm; - + #ifdef QUESO_HAS_TRILINOS //! Epetra_Map Epetra_Map* m_epetraMap; #else //! Total number of elements across all processors. int m_numGlobalElements; - - //! Base integer value for indexed array references. + + //! Base integer value for indexed array references. int m_indexBase; - + //! Number of elements owned by the calling processor. int m_numMyElements; #endif diff --git a/src/core/inc/Matrix.h b/src/core/inc/Matrix.h index 77045e9aa..eca06c79d 100644 --- a/src/core/inc/Matrix.h +++ b/src/core/inc/Matrix.h @@ -36,9 +36,9 @@ namespace QUESO { */ /*! \class Matrix - \brief Class for matrix operations (virtual). - - Base matrix class. The matrix class is an abstract class designed to be used as a base class + \brief Class for matrix operations (virtual). + + Base matrix class. The matrix class is an abstract class designed to be used as a base class for different matrix implementations (all actual matrix classes in QUESO). */ @@ -47,95 +47,95 @@ class Matrix { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. Matrix(); - + //! Shaped constructor. Matrix(const BaseEnvironment& env, const Map& map); - + //! Copy constructor. Matrix(const Matrix& rhs); - + //! Virtual Destructor virtual ~Matrix(); //@} //! @name Set methods - //@{ + //@{ //! Operator for copying a matrix. Matrix& operator= (const Matrix& rhs); - + //! Operator for multiplication of the matrix by a scalar. Matrix& operator*=(double a); - + //! Operator for addition (element-wise) of two matrices. Matrix& operator+=(const Matrix& rhs); - + //! Operator for subtraction (element-wise) of two matrices. Matrix& operator-=(const Matrix& rhs); //@} //! @name Environment and Map methods - //@{ + //@{ const BaseEnvironment& env () const; const Map& map () const; unsigned int numOfProcsForStorage() const; - //@} - + //@} + //! @name Attribute methods - //@{ - //! Returns the number of rows local of the matrix. + //@{ + //! Returns the number of rows local of the matrix. virtual unsigned int numRowsLocal () const = 0; - - //! Returns the number of rows global of the matrix. + + //! Returns the number of rows global of the matrix. virtual unsigned int numRowsGlobal () const = 0; - - //! Returns the number of columns local of the matrix. + + //! Returns the number of columns local of the matrix. virtual unsigned int numCols () const = 0; //@} - + //! @name Mathematical methods - //@{ + //@{ //! Performs Cholesky factorization of the matrix. virtual int chol () = 0; //@} - - + + //! @name Get/Set methods - //@{ + //@{ //! Sets to zero all the elements bellow (including or not) the diagonal of the matrix. virtual void zeroLower (bool includeDiagonal = false) = 0; - + //! Sets to zero all the elements above (including or not) the diagonal of the matrix. virtual void zeroUpper (bool includeDiagonal = false) = 0; //@} - + //! @name I/O and Miscellaneous methods - //@{ + //@{ //! Print this matrix. virtual void print (std::ostream& os) const = 0; - //! Determines whether the matrix should be printed horizontally. + //! Determines whether the matrix should be printed horizontally. void setPrintHorizontally(bool value) const; // Yes, 'const' - - //! Checks if matrix will be is printed horizontally. + + //! Checks if matrix will be is printed horizontally. bool getPrintHorizontally() const; - - //! Determines whether QUESO will run through this class in debug mode. + + //! Determines whether QUESO will run through this class in debug mode. void setInDebugMode (bool value) const; // Yes, 'const' - - //! Checks if QUESO will run through this class in debug mode. + + //! Checks if QUESO will run through this class in debug mode. bool getInDebugMode () const; //@} - + protected: //! Copies matrix \c src to \c this matrix. virtual void copy (const Matrix& src); //! QUESO environment variable. const BaseEnvironment& m_env; - + #ifdef QUESO_CLASSES_INSTANTIATE_NEW_MAPS //! Mapping variable. @@ -150,7 +150,7 @@ class Matrix //! Flag for either or not print this matrix. mutable bool m_printHorizontally; - + //! Flag for either or not QUESO is in debug mode. mutable bool m_inDebugMode; }; diff --git a/src/core/inc/MpiComm.h b/src/core/inc/MpiComm.h index a5da4610e..b806fa111 100644 --- a/src/core/inc/MpiComm.h +++ b/src/core/inc/MpiComm.h @@ -40,7 +40,7 @@ typedef MPI_Group RawType_MPI_Group ; typedef MPI_Datatype RawType_MPI_Datatype ; typedef MPI_Op RawType_MPI_Op ; typedef MPI_Status RawType_MPI_Status ; -#define RawValue_MPI_COMM_SELF MPI_COMM_SELF +#define RawValue_MPI_COMM_SELF MPI_COMM_SELF #define RawValue_MPI_IN_PLACE MPI_IN_PLACE #define RawValue_MPI_ANY_SOURCE MPI_ANY_SOURCE #define RawValue_MPI_CHAR MPI_CHAR @@ -62,11 +62,11 @@ namespace QUESO { /*! \class MpiComm \brief The QUESO MPI Communicator Class. - - This class uses MPI (the Message Passing Interface) for distributed-memory - communication between one or more parallel processes. It is meant to insulate - the user from the specifics of communication that are not required for normal - manipulation of linear algebra objects. + + This class uses MPI (the Message Passing Interface) for distributed-memory + communication between one or more parallel processes. It is meant to insulate + the user from the specifics of communication that are not required for normal + manipulation of linear algebra objects. */ @@ -76,61 +76,61 @@ class MpiComm { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor /*! It should not be used by user.*/ MpiComm(); - + //! QUESO MpiComm MPI Constructor. - /*! This constructs an MpiComm that uses the given "raw" MPI communicator underneath. + /*! This constructs an MpiComm that uses the given "raw" MPI communicator underneath. * The MPI_Comm must be valid for the lifetime of this MpiComm.*/ MpiComm(const BaseEnvironment& env, RawType_MPI_Comm inputRawComm); - + //! Copy Constructor. /** Makes an exact copy of an existing MpiComm instance.*/ MpiComm(const MpiComm& src); - + //! Destructor ~MpiComm(); //@} - + //! @name Set methods //@{ - //! Assignment operator. + //! Assignment operator. MpiComm& operator= (const MpiComm& rhs); //@} - - + + //! @name Attribute Accessor Methods //@{ - //! Extract MPI Communicator from a MpiComm object. + //! Extract MPI Communicator from a MpiComm object. RawType_MPI_Comm Comm () const; - - //! Return my process ID. + + //! Return my process ID. int MyPID () const; - - //! Returns total number of processes. + + //! Returns total number of processes. int NumProc () const; //@} - + //! @name Methods Overridden from Comm - //@{ - //! Combines values from all processes and distributes the result back to all processes + //@{ + //! Combines values from all processes and distributes the result back to all processes /*! \param sendbuf starting address of send buffer * \param count number of elements in send buffer * \param datatype data type of elements of send buffer * \param op operation * \param recvbuf (output) starting address of receive buffer*/ - void Allreduce(void* sendbuf, void* recvbuf, int count, RawType_MPI_Datatype datatype, + void Allreduce(void* sendbuf, void* recvbuf, int count, RawType_MPI_Datatype datatype, RawType_MPI_Op op, const char* whereMsg, const char* whatMsg) const; - - //! Pause every process in *this communicator until all the processes reach this point. - /*! Blocks the caller until all processes in the communicator have called it; that is, - * the call returns at any process only after all members of the communicator have entered the call.*/ + + //! Pause every process in *this communicator until all the processes reach this point. + /*! Blocks the caller until all processes in the communicator have called it; that is, + * the call returns at any process only after all members of the communicator have entered the call.*/ void Barrier () const; // const char* whereMsg, const char* whatMsg) const; - - //! Broadcast values from the root process to the slave processes. + + //! Broadcast values from the root process to the slave processes. /*! Broadcasts a message from the process with rank "root" to all other processes of the communicator. * \param buffer (input/output) starting address of buffer * \param count number of entries in buffer @@ -138,86 +138,86 @@ class MpiComm * \param root rank of broadcast root */ void Bcast (void* buffer, int count, RawType_MPI_Datatype datatype, int root, const char* whereMsg, const char* whatMsg) const; - - //! Gather values from each process to collect on all processes. - /*!\param sendbuf starting address of send buffer - * \param sendcnt number of elements in send buffer + + //! Gather values from each process to collect on all processes. + /*!\param sendbuf starting address of send buffer + * \param sendcnt number of elements in send buffer * \param sendtype data type of send buffer elements - * \param recvcount number of elements for any single receive - * \param recvtype data type of recv buffer elements - * \param root rank of receiving process - * \param recvbuf (output) address of receive buffer */ - void Gather (void *sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, - void *recvbuf, int recvcount, RawType_MPI_Datatype recvtype, + * \param recvcount number of elements for any single receive + * \param recvtype data type of recv buffer elements + * \param root rank of receiving process + * \param recvbuf (output) address of receive buffer */ + void Gather (void *sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, + void *recvbuf, int recvcount, RawType_MPI_Datatype recvtype, int root, const char* whereMsg, const char* whatMsg) const; - + //! Gathers into specified locations from all processes in a group /*! \param sendbuf starting address of send buffer - * \param sendcount number of elements in send buffer - * \param sendtype data type of send buffer elements - * \param recvcounts integer array (of length group size) containing the number of elements + * \param sendcount number of elements in send buffer + * \param sendtype data type of send buffer elements + * \param recvcounts integer array (of length group size) containing the number of elements * that are received from each process - * \param displs integer array (of length group size). Entry i specifies the displacement - * relative to recvbuf at which to place the incoming data from process i - * \param recvtype data type of recv buffer elements - * \param root rank of receiving process*/ - void Gatherv (void *sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, - void *recvbuf, int *recvcnts, int *displs, RawType_MPI_Datatype recvtype, + * \param displs integer array (of length group size). Entry i specifies the displacement + * relative to recvbuf at which to place the incoming data from process i + * \param recvtype data type of recv buffer elements + * \param root rank of receiving process*/ + void Gatherv (void *sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, + void *recvbuf, int *recvcnts, int *displs, RawType_MPI_Datatype recvtype, int root, const char* whereMsg, const char* whatMsg) const; - - //! Blocking receive of data from this process to another process. + + //! Blocking receive of data from this process to another process. /*!\param buf (output) initial address of receive buffer * \param status (output) status object * \param count maximum number of elements in receive buffer * \param datatype datatype of each receive buffer element * \param source rank of source - * \param tag message tag */ + * \param tag message tag */ void Recv (void *buf, int count, RawType_MPI_Datatype datatype, int source, int tag, RawType_MPI_Status *status, const char* whereMsg, const char* whatMsg) const; - - //! Possibly blocking send of data from this process to another process. + + //! Possibly blocking send of data from this process to another process. /*!\param buf initial address of send buffer * \param count number of elements in send buffer * \param datatype datatype of each send buffer element * \param dest rank of destination - * \param tag message tag*/ + * \param tag message tag*/ void Send (void *buf, int count, RawType_MPI_Datatype datatype, int dest, int tag, const char* whereMsg, const char* whatMsg) const; //@} - + //! @name Miscellaneous Methods - //@{ + //@{ //! Synchronizes all the processes and print debug message. void syncPrintDebugMsg(const char* msg, unsigned int msgVerbosity, unsigned int numUSecs) const; #ifdef QUESO_HAS_TRILINOS - //! Extract MPI Communicator from a Epetra_MpiComm object. + //! Extract MPI Communicator from a Epetra_MpiComm object. const Epetra_MpiComm& epetraMpiComm() const; #endif - + //@} private: //! Copies from an existing MpiComm instance. void copy (const MpiComm& src); - // QUESO environment + // QUESO environment const BaseEnvironment& m_env; #ifdef QUESO_HAS_TRILINOS - + // Epetra MPI communicator Epetra_MpiComm* m_epetraMpiComm; #endif //! Embedded wrapped opaque MPI_Comm object. RawType_MPI_Comm m_rawComm; - + //! World rank int m_worldRank; - + //! Process ID of this process int m_myPid; - + // Total number of processes int m_numProc; }; diff --git a/src/core/inc/OptimizerMonitor.h b/src/core/inc/OptimizerMonitor.h index fa89341c4..d073b9059 100644 --- a/src/core/inc/OptimizerMonitor.h +++ b/src/core/inc/OptimizerMonitor.h @@ -56,10 +56,10 @@ namespace QUESO * handful of dimensions over which you are optimizing. */ void set_display_output( bool enable_output, bool print_xmin ); - + //! Add current value of minimizer, objective, and error norm void append( std::vector& x_min, double objective, double norm ); - + //! Clears internal datastructures and resets display variables to false. void reset(); @@ -73,7 +73,7 @@ namespace QUESO private: const BaseEnvironment& m_env; - + bool m_display_conv; bool m_print_xmin; diff --git a/src/core/inc/RngBase.h b/src/core/inc/RngBase.h index 4eba7260c..07e057a0c 100644 --- a/src/core/inc/RngBase.h +++ b/src/core/inc/RngBase.h @@ -35,47 +35,47 @@ namespace QUESO { */ /*! \class RngBase - \brief Class for random number generation (base class for either GSL or Boost RNG). - - This class is a ā€œvirtualā€ class of generic random number generator, in order - to accommodate either GSL or Boost RNG. + \brief Class for random number generation (base class for either GSL or Boost RNG). + + This class is a ā€œvirtualā€ class of generic random number generator, in order + to accommodate either GSL or Boost RNG. */ class RngBase { public: - + //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor: it should not be used. RngBase(); - + //! Constructor with seed. RngBase(int seed, int worldRank); - + //! Virtual destructor. virtual ~RngBase(); //@} - - + + //! @name Sampling methods - //@{ + //@{ //! Sets the seed. int seed () const; - + //! Resets the seed with value \c newSeed. virtual void resetSeed (int newSeed); - + //! Samples a value from a uniform distribution. virtual double uniformSample () const = 0; - + //! Samples a value from a Gaussian distribution with standard deviation given by \c stdDev. virtual double gaussianSample(double stdDev) const = 0; - + //! Samples a value from a Beta distribution. virtual double betaSample (double alpha, double beta) const = 0; - + //! Samples a value from a Gamma distribution. virtual double gammaSample (double a, double b) const = 0; @@ -83,12 +83,12 @@ class RngBase protected: //! Seed. int m_seed; - + //! Rank of processor. int m_worldRank; private: - + //! Reset seed. void privateResetSeed(); }; diff --git a/src/core/inc/RngBoost.h b/src/core/inc/RngBoost.h index 7ee5a722b..62f7f986b 100644 --- a/src/core/inc/RngBoost.h +++ b/src/core/inc/RngBoost.h @@ -27,7 +27,7 @@ #include #include -#include +#include /*! \file RngBoost.h @@ -35,10 +35,10 @@ */ /*! \class RngBoost - \brief Class for random number generation using Boost library. - - This class is class of random number generator, using Boost library. The Boost Random Number - Generator Library provides a framework for random number generators with well-defined properties + \brief Class for random number generation using Boost library. + + This class is class of random number generator, using Boost library. The Boost Random Number + Generator Library provides a framework for random number generators with well-defined properties so that the generators can be used in the demanding numerics and security domain. */ @@ -48,64 +48,64 @@ class RngBoost : public RngBase { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor: it should not be used. RngBoost(); - + //! Constructor with seed. RngBoost(int seed, int worldRank); - + //! Destructor ~RngBoost(); //@} - + //! @name Sampling methods - //@{ - //! Resets the seed with value \c newSeed. + //@{ + //! Resets the seed with value \c newSeed. void resetSeed (int newSeed); - - + + //! Samples a value from a uniform distribution. Support: [0,1] or [a,b]. /*! This function samples from continuous uniform distribution on the range [0,1). It is - * possible to scale this distribution so the support is defined by the two parameters, + * possible to scale this distribution so the support is defined by the two parameters, * a and b, which are its minimum and maximum values. Support: -infinity < a < x< b< infinity. * Uses boost::uniform_01 zeroone(m_rng).*/ double uniformSample () const; - - - //! Samples a value from a Gaussian distribution with standard deviation given by \c stdDev. + + + //! Samples a value from a Gaussian distribution with standard deviation given by \c stdDev. //! Support: (-infinity, infinity). - /*! The parameter mu (mean or expectation of the distribution) in this Gaussian sample isn't - * present, and thus, needs to be provided. e.g., in the form of a sum. The parameter stdDev is - * its standard deviation; its variance is therefore stdDev^2. A random variable with a Gaussian + /*! The parameter mu (mean or expectation of the distribution) in this Gaussian sample isn't + * present, and thus, needs to be provided. e.g., in the form of a sum. The parameter stdDev is + * its standard deviation; its variance is therefore stdDev^2. A random variable with a Gaussian * distribution is said to be normally distributed and is called a normal deviate. Uses - * boost::math::normal_distribution gaussian_dist(mean, stdDev) Support (domain): + * boost::math::normal_distribution gaussian_dist(mean, stdDev) Support (domain): * (-infinity, infinity). */ double gaussianSample(double stdDev) const; - + //! Samples a value from a Beta distribution. Support: [0,1] - /*! The Beta Distribution is a continuous probability distribution; it has two free - * parameters, which are labeled alpha and beta. The beta distribution is used as a - * prior distribution for binomial proportions in Bayesian analysis (Evans et al. + /*! The Beta Distribution is a continuous probability distribution; it has two free + * parameters, which are labeled alpha and beta. The beta distribution is used as a + * prior distribution for binomial proportions in Bayesian analysis (Evans et al. * 2000, p. 34). Uses boost::math::beta_distribution beta_dist(alpha, beta). * Support (domain): [0,1].*/ double betaSample (double alpha, double beta) const; - + //! Samples a value from a Gamma distribution. Support: [0,infinity). - /*! The Gamma Distribution is a continuous probability distribution; it has two free + /*! The Gamma Distribution is a continuous probability distribution; it has two free * parameters, which may be labeled: a shape parameter a and an inverse scale parameter - * b, called a rate parameter. The parameterization with a and b is more common in - * Bayesian statistics, where the gamma distribution is used as a conjugate prior distribution - * for various types of inverse scale (aka rate) parameters. Uses + * b, called a rate parameter. The parameterization with a and b is more common in + * Bayesian statistics, where the gamma distribution is used as a conjugate prior distribution + * for various types of inverse scale (aka rate) parameters. Uses * boost::math::gamma_distribution gamma_dist(a,b). Support (domain): [0,infinity).*/ double gammaSample (double a, double b) const; - -private: - //! Random number generator from class boost::mt19937. - /*! mt19937 are models for a pseudo-random number generator. Here it is cannot be static, - * as it has not been initialized yet. mt19937 has length cycle of 2^(19937)-1, requires - * approximately 625*sizeof(uint32_t) of memory, has relatively high speed (93% of the - * fastest available in Boost library), and provides good uniform distribution in up to + +private: + //! Random number generator from class boost::mt19937. + /*! mt19937 are models for a pseudo-random number generator. Here it is cannot be static, + * as it has not been initialized yet. mt19937 has length cycle of 2^(19937)-1, requires + * approximately 625*sizeof(uint32_t) of memory, has relatively high speed (93% of the + * fastest available in Boost library), and provides good uniform distribution in up to * 623 dimensions. */ boost::mt19937 m_rng; // it cannot be static, as it is not initialized yet }; diff --git a/src/core/inc/RngGsl.h b/src/core/inc/RngGsl.h index d4d3953d9..393e853b4 100644 --- a/src/core/inc/RngGsl.h +++ b/src/core/inc/RngGsl.h @@ -34,11 +34,11 @@ */ /*! \class RngGsl - \brief Class for random number generation using GSL library. - - This class is class of random number generator, using GSL library. The GSL library - provides a large collection of random number generators which can be accessed through - a uniform interface. + \brief Class for random number generation using GSL library. + + This class is class of random number generator, using GSL library. The GSL library + provides a large collection of random number generators which can be accessed through + a uniform interface. */ @@ -49,56 +49,56 @@ namespace QUESO { class RngGsl : public RngBase { public: - + //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor: it should not be used. RngGsl(); - + //! Constructor with seed. /* Uses GSL with the generator of type: gsl_rng_ranlxd2. This is the second, of a total of three - luxury random numbers, all an extension of a second-generation version of the ranlux algorithm of - LĆ¼scher. The period of the generator is about 10^171. The algorithm has mathematically proven - properties and can provide truly decorrelated numbers at a known level of randomness. The higher + luxury random numbers, all an extension of a second-generation version of the ranlux algorithm of + LĆ¼scher. The period of the generator is about 10^171. The algorithm has mathematically proven + properties and can provide truly decorrelated numbers at a known level of randomness. The higher luxury levels provide increased decorrelation between samples as an additional safety margin.*/ RngGsl(int seed, int worldRank); - + //! Destructor ~RngGsl(); //@} //! @name Sampling methods - //@{ - //! Resets the seed with value \c newSeed. + //@{ + //! Resets the seed with value \c newSeed. void resetSeed (int newSeed); - + //! Samples a value from a uniform distribution. Support: [0,1] or [a,b]. /*! This function samples from continuous uniform distribution on the range [0,1). It is - * possible to scale this distribution so the support is defined by the two parameters, + * possible to scale this distribution so the support is defined by the two parameters, * a and b, which are its minimum and maximum values. Support: -infinity < a < x< b< infinity. * Uses gsl_rng_uniform(m_rng).*/ double uniformSample () const; - - //! Samples a value from a Gaussian distribution with standard deviation given by \c stdDev. + + //! Samples a value from a Gaussian distribution with standard deviation given by \c stdDev. //! Support: (-infinity, infinity). - /*! The parameter mu (mean or expectation of the distribution) in this Gaussian sample is - * set to zero, and thus, needs to be provided in an alternative way (e.g., in the form of - * a sum. The parameter stdDev is its standard deviation; its variance is therefore stdDev^2. - * A random variable with a Gaussian distribution is said to be normally distributed and is + /*! The parameter mu (mean or expectation of the distribution) in this Gaussian sample is + * set to zero, and thus, needs to be provided in an alternative way (e.g., in the form of + * a sum. The parameter stdDev is its standard deviation; its variance is therefore stdDev^2. + * A random variable with a Gaussian distribution is said to be normally distributed and is * called a normal deviate. Uses gsl_ran_gaussian(). Support: (-infinity, infinity). */ double gaussianSample(double stdDev) const; - + //! Samples a value from a Beta distribution. Support: [0,1] - /*! The Beta Distribution is a continuous probability distribution; it has two free - * parameters, which are labeled alpha and beta. The beta distribution is used as a - * prior distribution for binomial proportions in Bayesian analysis (Evans et al. + /*! The Beta Distribution is a continuous probability distribution; it has two free + * parameters, which are labeled alpha and beta. The beta distribution is used as a + * prior distribution for binomial proportions in Bayesian analysis (Evans et al. * 2000, p. 34). Uses gsl_ran_beta(). Support (domain): [0,1].*/ double betaSample (double alpha, double beta) const; - + //! Samples a value from a Gamma distribution. Support: [0,infinity). - /*! The Gamma Distribution is a continuous probability distribution; it has two - * free parameters, which may be labeled: a shape parameter a and an inverse - * scale parameter b, called a rate parameter. Uses gsl_ran_gamma(). Support + /*! The Gamma Distribution is a continuous probability distribution; it has two + * free parameters, which may be labeled: a shape parameter a and an inverse + * scale parameter b, called a rate parameter. Uses gsl_ran_gamma(). Support * (domain): [0,infinity).*/ double gammaSample (double a, double b) const; @@ -106,7 +106,7 @@ class RngGsl : public RngBase const gsl_rng* rng () const; protected: - //! GSL random number generator. + //! GSL random number generator. /*! It is chosen, in the constructor, to be of type gsl_rng_ranlxd2. */ gsl_rng* m_rng; }; diff --git a/src/core/inc/TeuchosMatrix.h b/src/core/inc/TeuchosMatrix.h index 8fefa596f..04d929712 100644 --- a/src/core/inc/TeuchosMatrix.h +++ b/src/core/inc/TeuchosMatrix.h @@ -44,9 +44,9 @@ namespace QUESO { /*! \class TeuchosMatrix \brief Class for matrix operations using Teuchos (Trilinos). - - This class creates and provides basic support for matrices of templated - type as a specialization of Matrix using Teuchos matrices (from Trilinos), which are defined + + This class creates and provides basic support for matrices of templated + type as a specialization of Matrix using Teuchos matrices (from Trilinos), which are defined by an encapsulated Teuchos::SerialDenseMatrix structure. */ @@ -54,339 +54,339 @@ class TeuchosMatrix : public Matrix { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor /*! Creates an empty matrix vector of no dimension. It should not be used by user.*/ TeuchosMatrix(); - - //! Shaped Constructor: creates a shaped matrix with \c numCols columns. + + //! Shaped Constructor: creates a shaped matrix with \c numCols columns. TeuchosMatrix(const BaseEnvironment& env, const Map& map, unsigned int numCols); - - //! Shaped Constructor: creates a square matrix with size \c map.NumGlobalElements() and diagonal values all equal to \c diagValue. + + //! Shaped Constructor: creates a square matrix with size \c map.NumGlobalElements() and diagonal values all equal to \c diagValue. TeuchosMatrix(const BaseEnvironment& env, const Map& map, - double diagValue); - - //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. + double diagValue); + + //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal() and diagonal values all equal to \c diagValue. TeuchosMatrix(const TeuchosVector& v, - double diagValue); - - //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal(). - /*! The diagonal values of this matrix are the elements in vector \c v. */ - TeuchosMatrix(const TeuchosVector& v); - + double diagValue); + + //! Shaped Constructor: creates a square matrix with size \c v.sizeLocal(). + /*! The diagonal values of this matrix are the elements in vector \c v. */ + TeuchosMatrix(const TeuchosVector& v); + //! Shaped Constructor: \c this matrix is a copy of matrix \c B. TeuchosMatrix(const TeuchosMatrix& B); - + //! Destructor ~TeuchosMatrix(); //@} //! @name Set methods - //@{ - //! Copies values from matrix \c rhs to \c this. + //@{ + //! Copies values from matrix \c rhs to \c this. TeuchosMatrix& operator= (const TeuchosMatrix& rhs); - + //! Stores in \c this the coordinate-wise multiplication of \c this and \c a. TeuchosMatrix& operator*=(double a); - + //! Stores in \c this the coordinate-wise division of \c this by \c a. TeuchosMatrix& operator/=(double a); - + //! Stores in \c this the coordinate-wise addition of \c this and \c rhs. TeuchosMatrix& operator+=(const TeuchosMatrix& rhs); //! Stores in \c this the coordinate-wise subtraction of \c this by \c rhs. TeuchosMatrix& operator-=(const TeuchosMatrix& rhs); //@} - + //! @name Accessor methods //@{ //! Element access method (non-const). double& operator()(unsigned int i, unsigned int j); - - //! Element access method (const). + + //! Element access method (const). const double& operator()(unsigned int i, unsigned int j) const; //@} //! @name Attribute methods - //@{ + //@{ //! Returns the local row dimension of \c this matrix. unsigned int numRowsLocal () const; - + //! Returns the global row dimension of \c this matrix. unsigned int numRowsGlobal () const; - + //! Returns the column dimension of \c this matrix. unsigned int numCols () const; - + //! Returns a pointer to the first element of \c this matrix. double* values () ;//added by Kemelli on 12/04/12 - - //! Returns the stride between the columns of this matrix in memory. + + //! Returns the stride between the columns of this matrix in memory. int stride () ;//added by Kemelli on 12/04/12 - + //! Returns the maximum element value of the matrix. double max () const; - - //! This function returns the number of singular values of \c this matrix (rank). + + //! This function returns the number of singular values of \c this matrix (rank). /*! The rank function provides an estimate of the number of linearly independent rows or columns of a full matrix. */ unsigned int rank (double absoluteZeroThreshold, double relativeZeroThreshold) const; - + //! This function calculates the transpose of \c this matrix (square). TeuchosMatrix transpose () const; - + //! This function calculates the inverse of \c this matrix (square). TeuchosMatrix inverse () const; - + //! Calculates the determinant of \c this matrix. double determinant () const; - + //! Calculates the ln(determinant) of \c this matrix. double lnDeterminant () const; //@} - + //! @name Norm methods - //@{ + //@{ //! Returns the Frobenius norm of \c this matrix. double normFrob () const; - + //! Returns the Frobenius norm of \c this matrix. double normMax () const; //@} - + //! @name Mathematical methods - //@{ - //! Computes Cholesky factorization of \c this, a real symmetric positive definite matrix. + //@{ + //! Computes Cholesky factorization of \c this, a real symmetric positive definite matrix. /*! In case \this fails to be symmetric and positive definite, an error will be returned. */ - int chol () ; - - //! Checks for the dimension of \c this matrix, \c matU, \c VecS and \c matVt, and calls the protected routine \c internalSvd to compute the singular values of \c this. + int chol () ; + + //! Checks for the dimension of \c this matrix, \c matU, \c VecS and \c matVt, and calls the protected routine \c internalSvd to compute the singular values of \c this. int svd (TeuchosMatrix& matU, TeuchosVector& vecS, TeuchosMatrix& matVt) const; - - //! This function calls private member TeuchosMatrix::internalSvd() to set a M-by-N orthogonal matrix U of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. + + //! This function calls private member TeuchosMatrix::internalSvd() to set a M-by-N orthogonal matrix U of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ const TeuchosMatrix& svdMatU () const; - - //! This function calls private member TeuchosMatrix::internalSvd() to set a N-by-N orthogonal square matrix V of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. + + //! This function calls private member TeuchosMatrix::internalSvd() to set a N-by-N orthogonal square matrix V of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. /*! A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T. */ const TeuchosMatrix& svdMatV () const; - - //! This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with TeuchosMatrix::svd (x=solVec, b=rhsVec). + + //! This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with TeuchosMatrix::svd (x=solVec, b=rhsVec). /*! An orthogonal matrix A has a norm-preserving property, i.e. for any vector v,\f[ ||Av|| = ||v|| \f] * Then: \f[ min( ||Ax - b||^2) = min(||Ax - b||) = min(||U D V^T x - b||) = min(||D V x - U b||)\f] - * Substituting \f[ y = V^T x \f] and \f[ b' = U^T b \f] gives us \f[ Dy = b'\f] with D being a diagonal matrix. + * Substituting \f[ y = V^T x \f] and \f[ b' = U^T b \f] gives us \f[ Dy = b'\f] with D being a diagonal matrix. * Or, \f[ y = inv(D) U^T b \f] and we only have to solve the linear system: \f[ V^T x = y\f] */ int svdSolve (const TeuchosVector& rhsVec, TeuchosVector& solVec) const; - + //! This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with TeuchosMatrix::svd (x=solMat, b=rhsMat). - /*! Note that solMat is a matrix. Thus, to solve the system of equations '\this * solMath = rhsMat', this method calls + /*! Note that solMat is a matrix. Thus, to solve the system of equations '\this * solMath = rhsMat', this method calls * svdSolve(const TeuchosVector& rhsVec, TeuchosVector& solVec) * passing one column of solMat with its respective column of rhsMat, .*/ int svdSolve (const TeuchosMatrix& rhsMat, TeuchosMatrix& solMat) const; - - + + //! This function multiplies \c this matrix by vector \c x and returns a vector. TeuchosVector multiply (const TeuchosVector& x) const; - + //! This function calculates the inverse of \c this matrix, multiplies it with vector \c b and stores the result in vector \c x. /*! It checks for a previous LU decomposition of \c this matrix and does not recompute it if private attribute m_LU != NULL .*/ void invertMultiply (const TeuchosVector& b, TeuchosVector& x) const; - - //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. + + //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. /*! It calls void TeuchosMatrix::invertMultiply(const TeuchosVector& b, TeuchosVector& x) internally.*/ TeuchosVector invertMultiply (const TeuchosVector& b) const; - + //! This function calculates the inverse of \c this matrix, multiplies it with matrix \c B and stores the result in matrix \c X. /*! It checks for a previous LU decomposition of \c this matrix and does not recompute it if private attribute \c m_LU != NULL .*/ void invertMultiply (const TeuchosMatrix& B, TeuchosMatrix& X) const; - + //! This function calculates the inverse of \c this matrix and multiplies it with matrix \c B. /*! It calls void TeuchosMatrix::invertMultiply(const TeuchosMatrix& B, TeuchosMatrix& X) const internally.*/ TeuchosMatrix invertMultiply (const TeuchosMatrix& B) const; - + //! This function calculates the inverse of \c this matrix, multiplies it with vector \c b and stores the result in vector \c x. /*! It recalculates the LU decomposition of \c this matrix.*/ void invertMultiplyForceLU (const TeuchosVector& b, TeuchosVector& x) const; - - //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. + + //! This function calculates the inverse of \c this matrix and multiplies it with vector \c b. /*! It calls void TeuchosMatrix::InvertMultiplyForceLU(const TeuchosVector& b, TeuchosVector& x) const;(const TeuchosVector& b, TeuchosVector& x) internally.*/ TeuchosVector invertMultiplyForceLU (const TeuchosVector& b) const; - + //! This function computes the eigenvalues of a real symmetric matrix. - void eigen (TeuchosVector& eigenValues, TeuchosMatrix* eigenVectors) const; - + void eigen (TeuchosVector& eigenValues, TeuchosMatrix* eigenVectors) const; + //! This function finds largest eigenvalue, namely \c eigenValue, of \c this matrix and its corresponding eigenvector, namely \c eigenVector. void largestEigen (double& eigenValue, TeuchosVector& eigenVector) const; - + //! This function finds smallest eigenvalue, namely \c eigenValue, of \c this matrix and its corresponding eigenvector, namely \c eigenVector. void smallestEigen (double& eigenValue, TeuchosVector& eigenVector) const; - + //@} - + //! @name Get/Set methods - //@{ - + //@{ + //! Component-wise set all values to \c this with value. void cwSet (double value); - + //! Set the components of \c which positions are greater than (rowId,colId) with the value of mat(rowId,colId). void cwSet (unsigned int rowId, unsigned int colId, const TeuchosMatrix& mat); - + //! This function gets the column_num-th column of \c this matrix and stores it into vector \c column. void getColumn (const unsigned int column_num, TeuchosVector& column) const; - + //! This function gets the column_num-th column of \c this matrix. TeuchosVector getColumn (const unsigned int column_num) const; - - //! This function copies vector \c column into the column_num-th column of \c this matrix. + + //! This function copies vector \c column into the column_num-th column of \c this matrix. void setColumn (const unsigned int column_num, const TeuchosVector& column); - + //! This function gets the row_num-th column of \c this matrix and stores it into vector \c row. void getRow (const unsigned int row_num, TeuchosVector& row) const; - + //! This function gets the row_num-th column of \c this matrix. TeuchosVector getRow (const unsigned int row_num) const; - - //! This function copies vector \c row into the row_num-th column of \c this matrix. + + //! This function copies vector \c row into the row_num-th column of \c this matrix. void setRow (const unsigned int row_num, const TeuchosVector& row); - + //! This function sets all the entries above the main diagonal (inclusive or not) of \c this matrix to zero. - /*! If \c includeDiagonal = false, then only the entries above the main diagonal are set to zero; + /*! If \c includeDiagonal = false, then only the entries above the main diagonal are set to zero; if \c includeDiagonal = true, then the elements of the matrix diagonal are also set to zero.*/ void zeroLower (bool includeDiagonal = false); - + //! This function sets all the entries bellow the main diagonal (inclusive or not) of \c this matrix to zero. - /*! If \c includeDiagonal = false, then only the entries bellow the main diagonal are set to zero; + /*! If \c includeDiagonal = false, then only the entries bellow the main diagonal are set to zero; if \c includeDiagonal = true, then the elements of the matrix diagonal are also set to zero.*/ void zeroUpper (bool includeDiagonal = false); - + //! This function sets to zero (filters) all entries of \c this matrix which are smaller than \c thresholdValue. /*! If \c thresholdValue < 0 then no values will be filtered.*/ void filterSmallValues (double thresholdValue); - + //! This function sets to zero (filters) all entries of \c this matrix which are greater than \c thresholdValue. - /*! If \c thresholdValue < 0 then no values will be filtered.*/ + /*! If \c thresholdValue < 0 then no values will be filtered.*/ void filterLargeValues (double thresholdValue); - + //! This function stores the transpose of \c this matrix into \c this matrix. - void fillWithTranspose (const TeuchosMatrix& mat); - + void fillWithTranspose (const TeuchosMatrix& mat); + //! This function fills \c this matrix diagonally with const block matrices. void fillWithBlocksDiagonally (const std::vector& matrices); - + //! This function fills \c this matrix diagonally with block matrices. void fillWithBlocksDiagonally (const std::vector< TeuchosMatrix* >& matrices); - + //! This function fills \c this matrix horizontally with const block matrices. void fillWithBlocksHorizontally(const std::vector& matrices); - + //! This function fills \c this matrix horizontally with block matrices. void fillWithBlocksHorizontally(const std::vector< TeuchosMatrix* >& matrices); - + //! This function fills \c this matrix vertically with const block matrices. void fillWithBlocksVertically (const std::vector& matrices); - + //! This function fills \c this matrix vertically with block matrices. void fillWithBlocksVertically (const std::vector< TeuchosMatrix* >& matrices); - + //! This function calculates the tensor product of matrices \c mat1 and \c mat2 and stores it in \c this matrix. void fillWithTensorProduct (const TeuchosMatrix& mat1, const TeuchosMatrix& mat2); - + //! This function calculates the tensor product of matrix \c mat1 and vector \c vec2 and stores it in \c this matrix. - void fillWithTensorProduct (const TeuchosMatrix& mat1, const TeuchosVector& vec2); + void fillWithTensorProduct (const TeuchosMatrix& mat1, const TeuchosVector& vec2); //@} - - + + //! @name Miscellaneous methods //@{ void mpiSum (const MpiComm& comm, TeuchosMatrix& M_global) const; - + void matlabLinearInterpExtrap (const TeuchosVector& x1Vec, const TeuchosMatrix& y1Mat, const TeuchosVector& x2Vec); //@} - + //! @name I/O methods //@{ - //! Print method. Defines the behavior of the ostream << operator inherited from the Object class. + //! Print method. Defines the behavior of the ostream << operator inherited from the Object class. void print (std::ostream& os) const; - + //! Read contents of subenvironment from file \c fileName. void subReadContents (const std::string& fileName, const std::string& fileType, const std::set& allowedSubEnvIds); - + //! Write contents of subenvironment in file \c fileName. void subWriteContents (const std::string& varNamePrefix, const std::string& fileName, const std::string& fileType, const std::set& allowedSubEnvIds) const; -//@} - +//@} + private: - - //! In this function \c this matrix receives a copy of matrix \c src. + + //! In this function \c this matrix receives a copy of matrix \c src. void copy (const TeuchosMatrix& src); - - //! In this function resets the LU decomposition of \c this matrix, as well as deletes the private member pointers, if existing. + + //! In this function resets the LU decomposition of \c this matrix, as well as deletes the private member pointers, if existing. void resetLU (); - + //! This function multiplies \c this matrix by vector \c x and stores the resulting vector in \c y. void multiply (const TeuchosVector& x, TeuchosVector& y) const; - - //! This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T for M >= N. On output the matrix A is replaced by U. - /*! This function uses Teuchos GESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing - * the left and/or right singular vectors. The SVD is written A = U * SIGMA * transpose(V), where SIGMA is - * an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal - * matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA are the singular values - * of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns + + //! This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T for M >= N. On output the matrix A is replaced by U. + /*! This function uses Teuchos GESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing + * the left and/or right singular vectors. The SVD is written A = U * SIGMA * transpose(V), where SIGMA is + * an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal + * matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA are the singular values + * of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns * of U and V are the left and right singular vectors of A. Note that the routine returns V**T, not V. */ int internalSvd () const; //! Teuchos matrix, also referred to as \c this matrix. Teuchos::SerialDenseMatrix m_mat; - - //! Teuchos matrix for the LU decomposition of m_mat. - mutable Teuchos::SerialDenseMatrix m_LU; - + + //! Teuchos matrix for the LU decomposition of m_mat. + mutable Teuchos::SerialDenseMatrix m_LU; + //! Stores the inverse of \c this matrix. mutable TeuchosMatrix* m_inverse; - + //! Mapping for matrices involved in the singular value decomposition (svd) routine. mutable Map* m_svdColMap; - + //! m_svdUmat stores the M-by-N orthogonal matrix U after the singular value decomposition of a matrix. mutable TeuchosMatrix* m_svdUmat; - + //! m_svdSvec stores the diagonal of the N-by-N diagonal matrix of singular values S after the singular value decomposition of a matrix. mutable TeuchosVector* m_svdSvec; - + //! m_svdVmat stores the N-by-N orthogonal square matrix V after the singular value decomposition of a matrix. mutable TeuchosMatrix* m_svdVmat; - + //! m_svdVmatT stores the transpose of N-by-N orthogonal square matrix V, namely V^T, after the singular value decomposition of a matrix. mutable TeuchosMatrix* m_svdVTmat; - - //! The determinant of \c this matrix. + + //! The determinant of \c this matrix. mutable double m_determinant; - + //! The natural logarithm of the determinant of \c this matrix. mutable double m_lnDeterminant; - + mutable TeuchosMatrix* m_permutation; - + //! The pivoting vector of a LU decomposition. - mutable int* v_pivoting; - - + mutable int* v_pivoting; + + mutable int m_signum; - + //! Indicates whether or not \c this matrix is singular. mutable bool m_isSingular; }; diff --git a/src/core/inc/TeuchosVector.h b/src/core/inc/TeuchosVector.h index be5ccab03..6340c47f5 100644 --- a/src/core/inc/TeuchosVector.h +++ b/src/core/inc/TeuchosVector.h @@ -45,67 +45,67 @@ namespace QUESO { /*! \class TeuchosVector \brief Class for vector operations using Teuchos (Trilinos). - - This class creates and provides basic support for vectors of templated - type as a specialization of Vector using Teuchos vectors (from Trilinos), which are defined - by an encapsulated Teuchos::SerialDenseVector structure. + + This class creates and provides basic support for vectors of templated + type as a specialization of Vector using Teuchos vectors (from Trilinos), which are defined + by an encapsulated Teuchos::SerialDenseVector structure. */ class TeuchosVector : public Vector { public: - + //! @name Constructor/Destructor methods. - //@{ + //@{ //! Default Constructor /*! Creates an empty vector of no length.*/ TeuchosVector(); - + //! Shaped constructor: creates an empty vector of size given by Map& map. TeuchosVector(const BaseEnvironment& env, const Map& map); - + //! Shaped constructor: creates an vector of values \c value and of size given by Map& map. TeuchosVector(const BaseEnvironment& env, const Map& map, double value); - + //! Shaped constructor: creates an vector of size given by Map& map and of values given by an average involving \c d1, \c d2 and the vector size. TeuchosVector(const BaseEnvironment& env, double d1, double d2, const Map& map); - + //! Shaped constructor: creates an vector of size given by vector \c v and of values given by an average involving \c d1, \c d2 and \c \this vector size. - TeuchosVector(const TeuchosVector& v, double d1, double d2); - + TeuchosVector(const TeuchosVector& v, double d1, double d2); + //! Copy constructor. TeuchosVector(const TeuchosVector& y); - + //! Destructor ~TeuchosVector(); //@} - + //! @name Set methods. - //@{ - //! Set all values in the vector to a constant value. + //@{ + //! Set all values in the vector to a constant value. TeuchosVector& operator= (double a); - - //! Copies values from one vector to another. + + //! Copies values from one vector to another. TeuchosVector& operator= (const TeuchosVector& rhs); - + //! Stores in \c this vector the coordinate-wise multiplication of \c this and a. TeuchosVector& operator*=(double a); - + //! Stores in \c this vector the coordinate-wise division of \c this by a. TeuchosVector& operator/=(double a); - + //! Stores in \c this vector the coordinate-wise multiplication of \c this with rhs. TeuchosVector& operator*=(const TeuchosVector& rhs); - + //! Stores in \c this vector the coordinate-wise division of \c this by rhs. TeuchosVector& operator/=(const TeuchosVector& rhs); - + //! Stores in \c this vector the coordinate-wise addition of \c this and rhs. TeuchosVector& operator+=(const TeuchosVector& rhs); - + //! Stores in \c this vector the coordinate-wise subtraction of \c this and \c rhs. TeuchosVector& operator-=(const TeuchosVector& rhs); //@} @@ -114,156 +114,156 @@ class TeuchosVector : public Vector //@{ //! Element access method (non-const). double& operator[](unsigned int i); - + //! Element access method (const). const double& operator[](unsigned int i) const; //@} //! @name Attribute methods. - //@{ + //@{ //! Returns the length of this vector unsigned int sizeLocal () const; - + //! Returns the global length of this vector. unsigned int sizeGlobal () const; - + //TODO double* values () ; - + //! Returns the maximum value in the \c this vector. double getMaxValue () const; - + //! Returns the minimum value in the \c this vector. double getMinValue () const; - + //! This function returns the index of the maximum value in the vector \c this. int getMaxValueIndex () const; - + //! This function returns the index of the minimum value in the vector \c this. int getMinValueIndex () const; - - //! This function returns maximum value in the vector \c this and its the index. + + //! This function returns maximum value in the vector \c this and its the index. void getMaxValueAndIndex( double& value, int& index ); - + //! This function returns minimum value in the vector \c this and its the index. void getMinValueAndIndex( double& value, int& index ); //@} - + //! @name Norm methods - //@{ + //@{ //! Returns the norm of the vector, as the square root of 2-norm of this vector. double norm2Sq () const; - + //! Returns the 2-norm (Euclidean norm) of the vector. double norm2 () const; - + //! Returns the 1-norm of the vector. double norm1 () const; - + //! Returns the infinity-norm (maximum norm) of the vector. double normInf () const; - - - //@} - - + + + //@} + + //! @name Comparison methods. - //@{ + //@{ //! This function returns true if at least one component of \c this is smaller than the respective component of rhs. bool atLeastOneComponentSmallerThan (const TeuchosVector& rhs) const; - - //! This function returns true if at least one component of \c this is bigger than the respective component of rhs. + + //! This function returns true if at least one component of \c this is bigger than the respective component of rhs. bool atLeastOneComponentBiggerThan (const TeuchosVector& rhs) const; - + //! This function returns true if at least one component of \c this is smaller than or equal to the respective component of rhs. bool atLeastOneComponentSmallerOrEqualThan(const TeuchosVector& rhs) const; - - //! This function returns true if at least one component of \c this is bigger than or equal to the respective component of rhs. + + //! This function returns true if at least one component of \c this is bigger than or equal to the respective component of rhs. bool atLeastOneComponentBiggerOrEqualThan (const TeuchosVector& rhs) const; //@} - + //! @name Set methods. - //@{ + //@{ //! Component-wise sets all values to \c this with value. void cwSet(double value); - + //! Component-wise sets all values of \c this with vector \c vec, starting at position \c initialPos. void cwSet(unsigned int initialPos, const TeuchosVector& vec); - + //! Component-wise extracts all values of \c this with vector \c vec, starting at position \c initialPos. - void cwExtract(unsigned int initialPos, TeuchosVector& vec) const; - - //! This function inverts component-wise the element values of \c this. + void cwExtract(unsigned int initialPos, TeuchosVector& vec) const; + + //! This function inverts component-wise the element values of \c this. void cwInvert(); - - //! Component-wise sets the square-root of \c this. + + //! Component-wise sets the square-root of \c this. void cwSqrt(); - + //! This function concatenates vectors \c v1 and \c v2 into \c this vector. void cwSetConcatenated(const TeuchosVector& v1, const TeuchosVector& v2); - - //! This function sets component-wise Gaussian random variates, with mean \c mean and standard deviation \c stdDev. + + //! This function sets component-wise Gaussian random variates, with mean \c mean and standard deviation \c stdDev. void cwSetGaussian(double mean, double stdDev); - + //! This function sets component-wise Gaussian random variates, with vectors for mean and standard deviation. void cwSetGaussian(const TeuchosVector& meanVec, const TeuchosVector& stdDevVec); - + //! This function sets component-wise a number uniformly distributed in the range of elements of [lowerBoundVec,upperBoundVec]. void cwSetUniform (const TeuchosVector& lowerBoundVec, const TeuchosVector& upperBoundVec); - + //! This function sets component-wise random variates from the Beta distribution, with vector parameters alpha and beta. void cwSetBeta (const TeuchosVector& alpha, const TeuchosVector& beta ); - + //! This function sets component-wise random variates from the Inverse Gamma distribution, with parameters given by vectors \c a and \c b. void cwSetGamma (const TeuchosVector& a, const TeuchosVector& b ); - + //! This function sets component-wise random variates from the Inverse Gamma distribution, with parameters given by vectors \c a and \c b. void cwSetInverseGamma(const TeuchosVector& a, const TeuchosVector& b ); //@} - + //! @name Miscellaneous methods. - //@{ - + //@{ + //! This function returns absolute value of all elements in \c this. TeuchosVector abs() const; - + //! Copies the values of \c this vector (a TeuchosVector) to a std::vector structure. /*! With this method, the std::vector copy of the TeuchosVector may be sorted using std::sort.*/ void copy_to_std_vector(std::vector& vec); // output - + //! Copies the values of std::vector structure to \c this vector (a TeuchosVector). /*! With this method, after a std::vector is sorted, it may be copied to a TeuchosVector.*/ - void copy_from_std_vector(const std::vector vec); - - //! This function sorts the elements of the vector \c this in ascending numerical order. + void copy_from_std_vector(const std::vector vec); + + //! This function sorts the elements of the vector \c this in ascending numerical order. /*! It copies \c this vector to a std::vector and uses the std::sort functionality to sort it. */ void sort (); - + //! Returns the sum of the components of the vector. double sumOfComponents () const; - - //! Broadcasts a message from the process with \c srcRank root to all other processes of the group. + + //! Broadcasts a message from the process with \c srcRank root to all other processes of the group. void mpiBcast (int srcRank, const MpiComm& bcastComm); - - //! Combines values from all processes and distributes the result back to all processes. + + //! Combines values from all processes and distributes the result back to all processes. void mpiAllReduce (RawType_MPI_Op mpiOperation, const MpiComm& opComm, TeuchosVector& resultVec) const; - - //! Gathers values from a group of processes and returns all quantiles. + + //! Gathers values from a group of processes and returns all quantiles. void mpiAllQuantile (double probability, const MpiComm& opComm, TeuchosVector& resultVec) const; - - //! Reproduces MATLAB linear inter/extra-polation. - /*! yiVec.matlabLinearInterpExtrap(xVec,yVec,xiVec) interpolates/extrapolates to find yiVec, the values of the - * underlying function yVec at the points in the vector xiVec. Thus, yVec and xVec must have the same size; + + //! Reproduces MATLAB linear inter/extra-polation. + /*! yiVec.matlabLinearInterpExtrap(xVec,yVec,xiVec) interpolates/extrapolates to find yiVec, the values of the + * underlying function yVec at the points in the vector xiVec. Thus, yVec and xVec must have the same size; * and yiVec and xiVec must have the same size.*/ void matlabLinearInterpExtrap(const TeuchosVector& xVec, const TeuchosVector& yVec, const TeuchosVector& xiVec); - + //TODO void matlabDiff (unsigned int firstPositionToStoreDiff, double valueForRemainderPosition, TeuchosVector& outputVec) const; //@} - + //! @name I/O methods. - //@{ + //@{ //! Print method. Defines the behavior of the std::ostream << operator inherited from the Object class. void print (std::ostream& os) const; void subReadContents (const std::string& fileName, @@ -273,17 +273,17 @@ class TeuchosVector : public Vector const std::string& fileName, const std::string& fileType, const std::set& allowedSubEnvIds) const; - //@} - + //@} + + - private: - + //! Teuchos vector. Teuchos::SerialDenseVector m_vec; - + //! This function copies the elements of the vector \c src into \c this. void copy (const TeuchosVector& src); diff --git a/src/core/inc/Vector.h b/src/core/inc/Vector.h index 7cb781868..35270e10e 100644 --- a/src/core/inc/Vector.h +++ b/src/core/inc/Vector.h @@ -37,123 +37,123 @@ namespace QUESO { */ /*! \class Vector - \brief Class for vector operations (virtual). - - Base vector class. The vector class is an abstract class designed to be used as a base class - for different vector implementations (all actual vector classes in QUESO). + \brief Class for vector operations (virtual). + + Base vector class. The vector class is an abstract class designed to be used as a base class + for different vector implementations (all actual vector classes in QUESO). */ class Vector { public: - + //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor Vector(); - + //! Shaped Constructor Vector(const BaseEnvironment& env, const Map& map); - - //! Copy Constructor + + //! Copy Constructor Vector(const Vector& rhs); - + //! Virtual Destructor virtual ~Vector(); //@} - + //! @name Set methods - //@{ - + //@{ + //! Operator for copying a vector. Vector& operator=(const Vector& rhs); - + //! Operator for multiplication of the vector by a scalar. Vector& operator*=(double a); - + //! Operator for division of the vector by a scalar. Vector& operator/=(double a); - + //! Operator for addition (element-wise) of two vectors. Vector& operator+=(const Vector& rhs); - + //! Operator for subtraction (element-wise) of two vectors. Vector& operator-=(const Vector& rhs); //@} - + //! @name Environment and Map methods - //@{ + //@{ const BaseEnvironment& env () const; const Map& map () const; unsigned int numOfProcsForStorage() const; //@} - + //! @name Attribute methods - //@{ + //@{ //! Returns the local size of the vector. virtual unsigned int sizeLocal () const = 0; - + //! Returns the global size of the vector. virtual unsigned int sizeGlobal () const = 0; //@} - + //! @name Get/Set methods - //@{ + //@{ //! Component-wise set the values of the vector to \c value. virtual void cwSet (double value) = 0; - + //! Component-wise set the values of the vector to a random number from a Gaussian distribution. virtual void cwSetGaussian (double mean, double stdDev) = 0; - + //! Component-wise invert the values of the vector. virtual void cwInvert () = 0; //@} - - + + //! @name I/O and Miscellaneous methods - //@{ + //@{ //! Sort the elements. virtual void sort () = 0; - + //! Print this vector. virtual void print (std::ostream& os) const = 0; - + //! Determines whether vector should be printed horizontally. void setPrintHorizontally(bool value) const; // Yes, 'const' - + //! Checks if vector is printed horizontally. bool getPrintHorizontally() const; - + //! Determines whether vector should be printed in Scientific Notation. void setPrintScientific (bool value) const; // Yes, 'const' - + //! Checks if the vector should be printed in Scientific Notation. bool getPrintScientific () const; - + //@} - + protected: - + //! Copies vector \c src to \c this matrix. virtual void copy (const Vector& src); //! Environment variable. const BaseEnvironment& m_env; - + #ifdef QUESO_CLASSES_INSTANTIATE_NEW_MAPS - + //! Mapping variable. const Map m_map; #else - + //! Mapping variable. const Map& m_map; #endif - + //! Flag for either or not print this matrix horizontally. mutable bool m_printHorizontally; - + //! Flag for either or not print this matrix in scientific notation. mutable bool m_printScientific; }; diff --git a/src/core/inc/exceptions.h b/src/core/inc/exceptions.h index b9f15c632..382841e55 100644 --- a/src/core/inc/exceptions.h +++ b/src/core/inc/exceptions.h @@ -54,7 +54,7 @@ namespace QUESO public: NotImplemented() : std::logic_error( "Error: not implemented!" ) {} }; - + /*! * A class representing a failed attempt by the library to open a * file (or construct an fstream, etc), to be thrown by diff --git a/src/core/src/BasicPdfsGsl.C b/src/core/src/BasicPdfsGsl.C index d47f60716..acaece7a5 100644 --- a/src/core/src/BasicPdfsGsl.C +++ b/src/core/src/BasicPdfsGsl.C @@ -66,7 +66,7 @@ BasicPdfsGsl::betaPdfActualValue(double x, double alpha, double beta) const //result = gsl_ran_beta_pdf(x,alpha,beta); result = 0.; } - return result; + return result; } // -------------------------------------------------- diff --git a/src/core/src/DistArray.C b/src/core/src/DistArray.C index d9f0eb67b..83ab0829a 100644 --- a/src/core/src/DistArray.C +++ b/src/core/src/DistArray.C @@ -42,7 +42,7 @@ DistArray::DistArray() "should not be called"); } -// Constructor for a given inputMap and inputRowSize. +// Constructor for a given inputMap and inputRowSize. template DistArray::DistArray(const Map& inputMap, const int inputRowSize) : m_Map(inputMap), diff --git a/src/core/src/Environment.C b/src/core/src/Environment.C index bcb944c0e..b7bf27295 100644 --- a/src/core/src/Environment.C +++ b/src/core/src/Environment.C @@ -35,7 +35,7 @@ #include #endif -// queso error handling +// queso error handling #include //----------------------------- @@ -51,15 +51,15 @@ namespace QUESO { os << "--------------------" << std::endl; os << "QUESO Library: Version = " << QUESO_LIB_VERSION; os << " (" << QUESO_get_numeric_version() << ")" << std::endl << std::endl; - + os << QUESO_LIB_RELEASE << std::endl << std::endl; - + os << "Build Date = " << QUESO_BUILD_DATE << std::endl; os << "Build Host = " << QUESO_BUILD_HOST << std::endl; os << "Build User = " << QUESO_BUILD_USER << std::endl; os << "Build Arch = " << QUESO_BUILD_ARCH << std::endl; os << "Build Rev = " << QUESO_BUILD_VERSION << std::endl << std::endl; - + os << "C++ Config = " << QUESO_CXX << " " << QUESO_CXXFLAGS << std::endl; os << std::endl; os << "Trilinos DIR = " << QUESO_TRILINOS_DIR << std::endl; @@ -70,39 +70,39 @@ namespace QUESO { os << "------------------------------------------------------------------------------------------" ; os << "--------------------" << std::endl; } - + return; } - + int QUESO_get_numeric_version() { // Note: return format follows the versioning convention xx.yy.z where // - // xx = major version number - // yy = minor version number + // xx = major version number + // yy = minor version number // zz = micro version number // // For example: // v. 0.23 -> 002300 = 2300 // v. 0.23.1 -> 002301 = 2301 // v. 10.23.2 -> 102302 - + int major_version = 0; int minor_version = 0; int micro_version = 0; - + #ifdef QUESO_MAJOR_VERSION major_version = QUESO_MAJOR_VERSION; #endif - + #ifdef QUESO_MINOR_VERSION minor_version = QUESO_MINOR_VERSION; #endif - + #ifdef QUESO_MICRO_VERSION micro_version = QUESO_MICRO_VERSION; #endif - + return(major_version*10000 + minor_version*100 + micro_version); } @@ -116,11 +116,11 @@ FilePtrSetStruct::FilePtrSetStruct() FilePtrSetStruct::~FilePtrSetStruct() { } - + + // + // queso terminate handler will be invoked for unhandled exceptions + // needs to be invoked in FullEnvironment constructor // - // queso terminate handler will be invoked for unhandled exceptions - // needs to be invoked in FullEnvironment constructor - // std::terminate_handler old_terminate_handler; //***************************************************** @@ -224,7 +224,7 @@ BaseEnvironment::operator= (const BaseEnvironment& rhs) "code should not execute through here"); return *this; } -// Environment, Communicator and Options Input File methods +// Environment, Communicator and Options Input File methods bool BaseEnvironment::fullEnvIsReady() const { @@ -592,7 +592,7 @@ BaseEnvironment::openOutputFile( << ", trying to open output file with base name '" << baseFileName << "." << fileType << "'" << ", writeOver = " << writeOver - << ": calling CheckFilePath()..." + << ": calling CheckFilePath()..." << std::endl; } int irtrn = CheckFilePath((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str()); @@ -615,7 +615,7 @@ BaseEnvironment::openOutputFile( // Write over an eventual pre-existing file ////////////////////////////////////////////////////////////// if (fileType == UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT) { - filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), + filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), std::ofstream::out | std::ofstream::trunc); } else if (fileType == UQ_FILE_EXTENSION_FOR_HDF_FORMAT) { @@ -646,14 +646,14 @@ BaseEnvironment::openOutputFile( ////////////////////////////////////////////////////////////// if (fileType == UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT) { #if 0 - filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), + filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), std::ofstream::in); std::cout << "filePtrSet.ofsVar(1) = " << filePtrSet.ofsVar << std::endl; if (filePtrSet.ofsVar) std::cout << "filePtrSet.ofsVar(1)->is_open() = " << filePtrSet.ofsVar->is_open() << std::endl; if (filePtrSet.ofsVar) delete filePtrSet.ofsVar; #endif // 'm' and Ranger nodes behave differently on ofstream constructor... prudenci 2010/03/05 - filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), + filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), std::ofstream::out /*| std::ofstream::in*/ | std::ofstream::app); } else if (fileType == UQ_FILE_EXTENSION_FOR_HDF_FORMAT) { @@ -685,7 +685,7 @@ BaseEnvironment::openOutputFile( (filePtrSet.ofsVar->is_open() == false)) { //std::cout << "Retrying 1..." << std::endl; delete filePtrSet.ofsVar; - filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), + filePtrSet.ofsVar = new std::ofstream((baseFileName+"_sub"+this->subIdString()+"."+fileType).c_str(), std::ofstream::out | std::ofstream::trunc); if ((m_subDisplayFile) && (this->displayVerbosity() > 10)) { // output debug *this->subDisplayFile() << "In BaseEnvironment::openOutputFile()" @@ -1273,11 +1273,11 @@ FullEnvironment::FullEnvironment( ////////////////////////////////////////////////// /*int iRC = 0;*/ /*iRC = */gettimeofday(&m_timevalBegin, NULL); - + if (m_fullRank == 0) { QUESO_version_print(std::cout); } - + if (m_fullRank == 0) { std::cout << "Beginning run at " << ctime(&m_timevalBegin.tv_sec) << std::endl; @@ -1383,7 +1383,7 @@ FullEnvironment::FullEnvironment( //////////////////////////////////////////////////////////////////// // Ensure that rank 0 has created path, if necessary, before other tasks use it //////////////////////////////////////////////////////////////////// - m_fullComm->Barrier(); + m_fullComm->Barrier(); if (openFile) { ////////////////////////////////////////////////////////////////// @@ -1491,7 +1491,7 @@ void queso_terminate_handler() { int mpi_initialized; MPI_Initialized (&mpi_initialized); - + if (mpi_initialized) { //MPI_Abort(m_fullComm->Comm(), 1); diff --git a/src/core/src/GslOptimizer.C b/src/core/src/GslOptimizer.C index 4fe7a3d93..bdecf3df0 100644 --- a/src/core/src/GslOptimizer.C +++ b/src/core/src/GslOptimizer.C @@ -169,7 +169,7 @@ GslOptimizer::GslOptimizer( { // We initialize the minimizer to GSL_NAN just in case the optimization fails m_minimizer->cwSet(GSL_NAN); - + // Set to documented default value. m_fstep_size.cwSet(0.1); } @@ -226,7 +226,7 @@ GslOptimizer::minimizer() const { return *(this->m_minimizer); } - + void GslOptimizer::set_solver_type( SolverType solver ) { m_solver_type = solver; diff --git a/src/core/src/GslVector.C b/src/core/src/GslVector.C index 0337a628e..66af5b9a2 100644 --- a/src/core/src/GslVector.C +++ b/src/core/src/GslVector.C @@ -818,7 +818,7 @@ GslVector::mpiBcast(int srcRank, const MpiComm& bcastComm) // Check that all participant nodes have the same vector size double localVectorSize = this->sizeLocal(); - double sumOfVectorSizes = 0.; + double sumOfVectorSizes = 0.; bcastComm.Allreduce((void *) &localVectorSize, (void *) &sumOfVectorSizes, (int) 1, RawValue_MPI_DOUBLE, RawValue_MPI_SUM, "GslVector::mpiBcast()", "failed MPI.Allreduce() for vectorSize"); diff --git a/src/core/src/InfiniteDimensionalLikelihoodBase.C b/src/core/src/InfiniteDimensionalLikelihoodBase.C index 760d3041d..94cd7fc9d 100644 --- a/src/core/src/InfiniteDimensionalLikelihoodBase.C +++ b/src/core/src/InfiniteDimensionalLikelihoodBase.C @@ -1,5 +1,5 @@ //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- diff --git a/src/core/src/InfiniteDimensionalMCMCSampler.C b/src/core/src/InfiniteDimensionalMCMCSampler.C index 320fa9779..76066857c 100644 --- a/src/core/src/InfiniteDimensionalMCMCSampler.C +++ b/src/core/src/InfiniteDimensionalMCMCSampler.C @@ -1,5 +1,5 @@ //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- @@ -123,7 +123,7 @@ InfiniteDimensionalMCMCSampler::InfiniteDimensionalMCMCSampler( this->current_physical_mean->zero(); this->current_physical_var->zero(); - // LibMeshFunction & p = libmesh_cast_ref(*(this->current_physical_state)); + // LibMeshFunction & p = libmesh_cast_ref(*(this->current_physical_state)); // Seed the sampler at the truth // for (unsigned int ii = 0; ii < 513; ii++) { @@ -209,7 +209,7 @@ void InfiniteDimensionalMCMCSampler::_update_moments() // Update running sum-of-squares boost::shared_ptr temp_ptr(this->_delta->zero_clone()); - // LibMeshFunction & temp = static_cast(*temp_ptr); + // LibMeshFunction & temp = static_cast(*temp_ptr); temp_ptr->pointwise_mult(*(this->_delta), *(this->current_physical_state)); this->_M2->add(1.0, *temp_ptr); @@ -231,7 +231,7 @@ void InfiniteDimensionalMCMCSampler::step() this->_propose(); this->_metropolis_hastings(); this->_update_moments(); - + // We never save the 0th iteration if (this->_iteration % this->m_ov->m_save_freq == 0) { this->_write_state(); diff --git a/src/core/src/InfiniteDimensionalMCMCSamplerOptions.C b/src/core/src/InfiniteDimensionalMCMCSamplerOptions.C index 6b251e9cb..130dd1aa7 100644 --- a/src/core/src/InfiniteDimensionalMCMCSamplerOptions.C +++ b/src/core/src/InfiniteDimensionalMCMCSamplerOptions.C @@ -1,5 +1,5 @@ //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- @@ -56,7 +56,7 @@ InfiniteDimensionalMCMCSamplerOptions::~InfiniteDimensionalMCMCSamplerOptions() if (m_optionsDesc) { delete m_optionsDesc; } -} +} void InfiniteDimensionalMCMCSamplerOptions::scanOptionsValues() { diff --git a/src/core/src/LibMeshNegativeLaplacianOperator.C b/src/core/src/LibMeshNegativeLaplacianOperator.C index 999509c8c..670381acb 100644 --- a/src/core/src/LibMeshNegativeLaplacianOperator.C +++ b/src/core/src/LibMeshNegativeLaplacianOperator.C @@ -83,7 +83,7 @@ LibMeshNegativeLaplacianOperator::LibMeshNegativeLaplacianOperator( es->parameters.set("basis vectors") = this->builder.num_req_eigenpairs * 3; - // Set the solver tolerance and the maximum number of iterations. + // Set the solver tolerance and the maximum number of iterations. es->parameters.set("linear solver tolerance") = pow(TOLERANCE, 5./3.); es->parameters.set("linear solver maximum iterations") = 1000; @@ -173,7 +173,7 @@ void LibMeshNegativeLaplacianOperator::assemble() // Tell the finite element object to use our quadrature rule. fe->attach_quadrature_rule (&qrule); - // The element Jacobian * quadrature weight at each integration point. + // The element Jacobian * quadrature weight at each integration point. const std::vector& JxW = fe->get_JxW(); // The element shape functions evaluated at the quadrature points. @@ -203,7 +203,7 @@ void LibMeshNegativeLaplacianOperator::assemble() libMesh::MeshBase::const_element_iterator el = mesh.active_local_elements_begin(); const libMesh::MeshBase::const_element_iterator end_el = mesh.active_local_elements_end(); - + for ( ; el != end_el; ++el) { // Store a pointer to the element we are currently // working on. This allows for nicer syntax later. @@ -232,7 +232,7 @@ void LibMeshNegativeLaplacianOperator::assemble() // Now loop over the quadrature points. This handles // the numeric integration. - // + // // We will build the element matrix. This involves // a double loop to integrate the test funcions (i) against // the trial functions (j). diff --git a/src/core/src/MpiComm.C b/src/core/src/MpiComm.C index bcbdc2a39..886fd6d56 100644 --- a/src/core/src/MpiComm.C +++ b/src/core/src/MpiComm.C @@ -166,13 +166,13 @@ MpiComm::Bcast(void* buffer, int count, RawType_MPI_Datatype datatype, int root, //-------------------------------------------------- void MpiComm::Gather( - void* sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, - void* recvbuf, int recvcount, RawType_MPI_Datatype recvtype, + void* sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, + void* recvbuf, int recvcount, RawType_MPI_Datatype recvtype, int root, const char* whereMsg, const char* whatMsg) const { - //int MPI_Gather (void *sendbuf, int sendcnt, MPI_Datatype sendtype, - // void *recvbuf, int recvcount, MPI_Datatype recvtype, + //int MPI_Gather (void *sendbuf, int sendcnt, MPI_Datatype sendtype, + // void *recvbuf, int recvcount, MPI_Datatype recvtype, // int root, MPI_Comm comm ) int mpiRC = MPI_Gather(sendbuf, sendcnt, sendtype, recvbuf, recvcount, recvtype, @@ -183,16 +183,16 @@ MpiComm::Gather( whatMsg); return; } -//-------------------------------------------------- +//-------------------------------------------------- void MpiComm::Gatherv( - void* sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, - void* recvbuf, int* recvcnts, int* displs, RawType_MPI_Datatype recvtype, + void* sendbuf, int sendcnt, RawType_MPI_Datatype sendtype, + void* recvbuf, int* recvcnts, int* displs, RawType_MPI_Datatype recvtype, int root, const char* whereMsg, const char* whatMsg) const { - //int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, - // void *recvbuf, int *recvcnts, int *displs, MPI_Datatype recvtype, + //int MPI_Gatherv(void *sendbuf, int sendcnt, MPI_Datatype sendtype, + // void *recvbuf, int *recvcnts, int *displs, MPI_Datatype recvtype, // int root, MPI_Comm comm ) int mpiRC = MPI_Gatherv(sendbuf, sendcnt, sendtype, recvbuf, recvcnts, displs, recvtype, diff --git a/src/core/src/RngBoost.C b/src/core/src/RngBoost.C index dbe479d50..1a010eb7d 100644 --- a/src/core/src/RngBoost.C +++ b/src/core/src/RngBoost.C @@ -58,7 +58,7 @@ RngBoost::~RngBoost() //this function does nothing } -// Sampling methods --------------------------------- +// Sampling methods --------------------------------- void RngBoost::resetSeed(int newSeed) { @@ -82,15 +82,15 @@ RngBoost::gaussianSample(double stdDev) const double mean = 0.; //it will be added conveniently later static boost::uniform_01 zeroone(m_rng); boost::math::normal_distribution gaussian_dist(mean, stdDev); - return quantile(gaussian_dist, zeroone()); + return quantile(gaussian_dist, zeroone()); } // -------------------------------------------------- double RngBoost::betaSample(double alpha, double beta) const { - static boost::uniform_01 zeroone(m_rng); - boost::math::beta_distribution beta_dist(alpha, beta); + static boost::uniform_01 zeroone(m_rng); + boost::math::beta_distribution beta_dist(alpha, beta); return quantile(beta_dist, zeroone()); } diff --git a/src/core/src/RngGsl.C b/src/core/src/RngGsl.C index e36124ce3..5f0e7b915 100644 --- a/src/core/src/RngGsl.C +++ b/src/core/src/RngGsl.C @@ -115,7 +115,7 @@ RngGsl::gammaSample(double a, double b) const return gsl_ran_gamma(m_rng,a,b); } -const gsl_rng* +const gsl_rng* RngGsl::rng() const { return m_rng; diff --git a/src/core/src/TeuchosMatrix.C b/src/core/src/TeuchosMatrix.C index feba92876..5e6b11199 100644 --- a/src/core/src/TeuchosMatrix.C +++ b/src/core/src/TeuchosMatrix.C @@ -38,20 +38,20 @@ namespace QUESO { using std:: cout; using std:: endl; // --------------------------------------------------- -// default constructor ------------------------------- +// default constructor ------------------------------- TeuchosMatrix::TeuchosMatrix() : Matrix() { //this part is never called. - UQ_FATAL_TEST_MACRO(true, + UQ_FATAL_TEST_MACRO(true, m_env.worldRank(), "TeuchosMatrix::constructor(), default", - "should not be used by user"); + "should not be used by user"); } // --------------------------------------------------- -// shaped constructor (square/rectangular)------------ +// shaped constructor (square/rectangular)------------ TeuchosMatrix::TeuchosMatrix( // can be a rectangular matrix const BaseEnvironment& env, const Map& map, @@ -66,16 +66,16 @@ TeuchosMatrix::TeuchosMatrix( // can be a rectangular matrix m_svdVTmat (NULL), m_determinant (-INFINITY), m_lnDeterminant(-INFINITY), - v_pivoting (NULL), + v_pivoting (NULL), m_signum (0), m_isSingular (false) { m_mat.shape(map.NumGlobalElements(),nCols); - m_LU.shape(0,0); + m_LU.shape(0,0); } // --------------------------------------------------- -// shaped constructor (square) ----------------------- +// shaped constructor (square) ----------------------- TeuchosMatrix::TeuchosMatrix( // square matrix const BaseEnvironment& env, const Map& map, @@ -90,19 +90,19 @@ TeuchosMatrix::TeuchosMatrix( // square matrix m_svdVTmat (NULL), m_determinant (-INFINITY), m_lnDeterminant(-INFINITY), - v_pivoting (NULL), + v_pivoting (NULL), m_signum (0), m_isSingular (false) { m_mat.shape (map.NumGlobalElements(),map.NumGlobalElements()); - m_LU.shape(0,0); + m_LU.shape(0,0); for (unsigned int i = 0; i < (unsigned int) m_mat.numRows(); ++i) { m_mat(i,i) = diagValue; } } // --------------------------------------------------- -// shaped constructor (diagonal) --------------------- +// shaped constructor (diagonal) --------------------- // Kemelli tested on 12/05/12 TeuchosMatrix::TeuchosMatrix( // square matrix const TeuchosVector& v, @@ -117,13 +117,13 @@ TeuchosMatrix::TeuchosMatrix( // square matrix m_svdVTmat (NULL), m_determinant (-INFINITY), m_lnDeterminant(-INFINITY), - v_pivoting (NULL), + v_pivoting (NULL), m_signum (0), m_isSingular (false) { m_mat.shape (v.sizeLocal(),v.sizeLocal()); - m_LU.shape(0,0); - + m_LU.shape(0,0); + for (unsigned int i = 0; i < (unsigned int) m_mat.numRows(); ++i) { m_mat(i,i) = diagValue; } @@ -148,8 +148,8 @@ TeuchosMatrix::TeuchosMatrix(const TeuchosVector& v) // square matrix m_isSingular (false) { m_mat.shape (v.sizeLocal(),v.sizeLocal()); - m_LU.shape(0,0); - + m_LU.shape(0,0); + unsigned int dim = v.sizeLocal(); for (unsigned int i = 0; i < dim; ++i) { @@ -157,7 +157,7 @@ TeuchosMatrix::TeuchosMatrix(const TeuchosVector& v) // square matrix } } // --------------------------------------------------- -// copy constructor----------------------------------- +// copy constructor----------------------------------- // Kemelli 12/05/12 - tested TeuchosMatrix::TeuchosMatrix(const TeuchosMatrix& B) // can be a rectangular matrix : @@ -170,19 +170,19 @@ TeuchosMatrix::TeuchosMatrix(const TeuchosMatrix& B) // can be a rectangular mat m_svdVTmat (NULL), m_determinant (-INFINITY), m_lnDeterminant(-INFINITY), - v_pivoting (NULL), + v_pivoting (NULL), m_signum (0), m_isSingular (false) { m_mat.shape (B.numRowsLocal(),B.numCols()); - m_LU.shape(0,0); - + m_LU.shape(0,0); + this->Matrix::copy(B); this->copy(B); } // --------------------------------------------------- -// destructor ---------------------------------------- +// destructor ---------------------------------------- TeuchosMatrix::~TeuchosMatrix() { this->resetLU(); @@ -229,11 +229,11 @@ TeuchosMatrix& TeuchosMatrix::operator+=(const TeuchosMatrix& rhs) this->resetLU(); unsigned int i,j, nrows=rhs.numRowsLocal(), ncols=rhs.numCols(); - + for(i=0; i< nrows ; i++) - for (j = 0; j < ncols; j++) + for (j = 0; j < ncols; j++) (*this)(i,j) += rhs(i,j); - + return *this; } // --------------------------------------------------- @@ -244,11 +244,11 @@ TeuchosMatrix::operator-=(const TeuchosMatrix& rhs) this->resetLU(); unsigned int i,j, nrows=rhs.numRowsLocal(), ncols=rhs.numCols(); - + for(i=0; i< nrows ; i++) - for (j = 0; j < ncols; j++) + for (j = 0; j < ncols; j++) (*this)(i,j) -= rhs(i,j); - + return *this; } @@ -296,7 +296,7 @@ const double& TeuchosMatrix::operator()(unsigned int i, unsigned int j) const // --------------------------------------------------- // Attribute methods --------------------------------- -// Kemelli 12/05/12 - tested +// Kemelli 12/05/12 - tested unsigned int TeuchosMatrix::numRowsLocal() const { @@ -305,7 +305,7 @@ TeuchosMatrix::numRowsLocal() const // --------------------------------------------------- // Kemelli 12/05/12 - tested -unsigned int +unsigned int TeuchosMatrix::numRowsGlobal() const { return (unsigned int) m_mat.numRows(); @@ -313,7 +313,7 @@ TeuchosMatrix::numRowsGlobal() const // --------------------------------------------------- // Kemelli 12/05/12 - tested -unsigned int +unsigned int TeuchosMatrix::numCols() const { return (unsigned int) m_mat.numCols(); @@ -474,8 +474,8 @@ TeuchosMatrix::inverse() const double TeuchosMatrix::determinant() const { - if (m_determinant == -INFINITY) - { + if (m_determinant == -INFINITY) + { if(m_LU.numRows() ==0 && m_LU.numCols() ==0) //dummy { TeuchosVector tmpB(m_env,m_map); @@ -497,17 +497,17 @@ TeuchosMatrix::determinant() const << ": before computing det" << std::endl; } - + double det = 1.0; double lnDet = 0.0; for (int i=0;i= 99)) { *m_env.subDisplayFile() << "In TeuchosMatrix::lnDeterminant()" << ": after computing det" @@ -523,7 +523,7 @@ TeuchosMatrix::determinant() const double TeuchosMatrix::lnDeterminant() const { - if (m_lnDeterminant == -INFINITY) + if (m_lnDeterminant == -INFINITY) { if(m_LU.numRows() ==0 && m_LU.numCols() ==0) //dummy { @@ -546,7 +546,7 @@ TeuchosMatrix::lnDeterminant() const << ": before computing lnDet" << std::endl; } - + double det = 1.0; double lnDet = 0.0; for (int i=0;i= 99)) { *m_env.subDisplayFile() << "In TeuchosMatrix::lnDeterminant()" << ": after computing lnDet" @@ -603,29 +603,29 @@ int TeuchosMatrix::chol() int return_success =0 ; /* If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower * triangular part of the matrix A (lets call it L), and the strictly upper - * triangular part of A is not referenced. Thus, the upper triangular part + * triangular part of A is not referenced. Thus, the upper triangular part * of A +++must be manually+++ overwritten with L^T. */ - + Teuchos::LAPACK lapack; int info;//= 0: successful exit //< 0: if INFO = -i, the i-th argument had an illegal value //> 0: if INFO = i, the leading minor of order i is not // positive definite, and the factorization could not be // completed. - char UPLO = 'U'; + char UPLO = 'U'; //= 'U': Upper triangle of A is stored; //= 'L': Lower triangle of A is stored. - + lapack.POTRF (UPLO, m_mat.numRows(), m_mat.values(), m_mat.stride(), &info); - - // Overwriting the upper triangular part of the input matrix A with L^T + + // Overwriting the upper triangular part of the input matrix A with L^T //(the diagonal terms are identical for both L and L^T) for (int i=0;inumRowsLocal(); unsigned int nCols = this->numCols(); unsigned int i; - + UQ_FATAL_TEST_MACRO((rhsVec.sizeLocal() != nRows), m_env.worldRank(), "TeuchosMatrix::svdSolve()", @@ -740,41 +740,41 @@ TeuchosMatrix::svdSolve(const TeuchosVector& rhsVec, TeuchosVector& solVec) cons if (iRC == 0) { - TeuchosMatrix invD = TeuchosMatrix(solVec); - TeuchosMatrix auxMatrix = TeuchosMatrix(solVec); - + TeuchosMatrix invD = TeuchosMatrix(solVec); + TeuchosMatrix auxMatrix = TeuchosMatrix(solVec); + for (i=0; ivalues()[i]); + invD(i,i) = 1./(m_svdSvec->values()[i]); } - - // GESV: For a system Ax=b, on entry, b contains the right-hand side b; + + // GESV: For a system Ax=b, on entry, b contains the right-hand side b; // on exit it contains the solution x. - // Thus, intead of doing y = inv(D)*UT*rhsVec = auxMatrix*rhsVec, with + // Thus, intead of doing y = inv(D)*UT*rhsVec = auxMatrix*rhsVec, with // auxMatrix = inv(D)*UT; and then assigning solVec=y (requirement for using GESV) - // lets do solVec= auxMatrix*rhsVec, and save one step in the calculation - + // lets do solVec= auxMatrix*rhsVec, and save one step in the calculation + auxMatrix = invD * svdMatU().transpose(); solVec = auxMatrix*rhsVec; // solve the linear system VT * solVec = y // GESV changes the values of the matrix, so lets make a copy of it and use it. - + TeuchosMatrix* aux_m_svdVTmat = new TeuchosMatrix(*m_svdVTmat); - + int ipiv[0], info; Teuchos::LAPACK lapack; - lapack.GESV(nCols, 1, aux_m_svdVTmat->values(), aux_m_svdVTmat->stride(), ipiv, &solVec[0], solVec.sizeLocal(), &info ); - + lapack.GESV(nCols, 1, aux_m_svdVTmat->values(), aux_m_svdVTmat->stride(), ipiv, &solVec[0], solVec.sizeLocal(), &info ); + /* GESV output INFO: = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value * > 0: if INFO = i, U(i,i) is exactly zero. The factorization * has been completed, but the factor U is exactly * singular, so the solution could not be computed. */ - + iRC = info; - delete aux_m_svdVTmat; + delete aux_m_svdVTmat; } - return iRC; + return iRC; } // --------------------------------------------------- @@ -816,7 +816,7 @@ TeuchosMatrix::svdSolve(const TeuchosMatrix& rhsMat, TeuchosMatrix& solMat) cons // --------------------------------------------------- // implemented/checked 1/8/13 // multiply this matrix by vector x and store in vector y, which is returned -// eg: TeuchosVector v1(paramSpace.zeroVector() ); +// eg: TeuchosVector v1(paramSpace.zeroVector() ); // v1=covMatrix.multiply(meanVector); TeuchosVector TeuchosMatrix::multiply(const TeuchosVector& x) const @@ -842,7 +842,7 @@ TeuchosMatrix::invertMultiply(const TeuchosVector& b) const "TeuchosMatrix::invertMultiply(), return vector", "matrix and rhs have incompatible sizes"); TeuchosVector x(m_env,m_map); - + this->invertMultiply(b,x); return x; @@ -862,18 +862,18 @@ TeuchosMatrix::invertMultiply(const TeuchosVector& b, TeuchosVector& x) const m_env.worldRank(), "TeuchosMatrix::invertMultiply(), return void", "solution and rhs have incompatible sizes"); - - if (m_LU.numCols() == 0 && m_LU.numRows() == 0) - { + + if (m_LU.numCols() == 0 && m_LU.numRows() == 0) + { UQ_FATAL_TEST_MACRO((v_pivoting != NULL), m_env.worldRank(), "TeuchosMatrix::invertMultiply()", "v_pivoting should be NULL"); - + //allocate m_LU and v_pivoting m_LU = m_mat; v_pivoting =(int *) malloc(sizeof(int)*m_LU.numCols() ); - + UQ_FATAL_TEST_MACRO((m_LU.numCols() == 0 && m_LU.numRows() == 0), m_env.worldRank(), "TeuchosMatrix::invertMultiply()", @@ -893,31 +893,31 @@ TeuchosMatrix::invertMultiply(const TeuchosVector& b, TeuchosVector& x) const cout << endl; } } - + // Perform an LU factorization of matrix m_LU. Checked 12/06/12 Teuchos::LAPACK lapack; int info; - - lapack.GETRF( m_LU.numRows(), m_LU.numCols(), m_LU.values(), m_LU.stride(), v_pivoting, &info ); - + + lapack.GETRF( m_LU.numRows(), m_LU.numCols(), m_LU.values(), m_LU.stride(), v_pivoting, &info ); + if (info != 0) { std::cerr << "In TeuchosMatrix::invertMultiply()" << ", after lapack.GETRF" << ": INFO = " << info << ",\nINFO < 0: if INFO = -i, the i-th argument had an illegal value.\n" - << "INFO > 0: if INFO = i, U(i,i) is exactly zero. The factorization \n" + << "INFO > 0: if INFO = i, U(i,i) is exactly zero. The factorization \n" << "has been completed, but the factor U is exactly singular, and division \n" << "by zero will occur if it is used to solve a system of equations." << std::endl; - } + } UQ_FATAL_RC_MACRO(info, m_env.worldRank(), "TeuchosMatrix::invertMultiplyForceLU()", "GETRF() failed"); - - if (info > 0) + + if (info > 0) m_isSingular = true; - + if (m_inDebugMode) { std::cout << "In TeuchosMatrix::invertMultiply()" << ": after LU decomposition, m_LU = "; @@ -925,41 +925,41 @@ TeuchosMatrix::invertMultiply(const TeuchosVector& b, TeuchosVector& x) const for (int j=0;j<3;j++) cout << m_LU(i,j) <<"\t" ; cout << endl; - } + } std::cout << std::endl; - } + } } if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In TeuchosMatrix::invertMultiply()" << ": before 'lapack.GETRS()'" << std::endl; } - + // Solve the linear system. Teuchos::LAPACK lapack; - int NRHS = 1; // NRHS: number of right hand sides, i.e., the number + int NRHS = 1; // NRHS: number of right hand sides, i.e., the number // of columns of the matrix B. In this case, vector b. - char TRANS = 'N'; // 'N': A * x= B (No transpose). Specifies the + char TRANS = 'N'; // 'N': A * x= B (No transpose). Specifies the // form of the system of equations. int info02; - - //GETRS expects the matrix to be already factored in LU and uses the + + //GETRS expects the matrix to be already factored in LU and uses the //same ipiv vector, which are the pivot indices of the LU factorization - x=b; + x=b; lapack.GETRS(TRANS, m_LU.numRows(), NRHS, m_LU.values(), m_LU.stride(), v_pivoting, &x[0],x.sizeLocal(), &info02 ); - + if (info02 != 0) { std::cerr << "In TeuchosMatrix::invertMultiply()" << ", after lapack.GETRS - solve LU system" << ": INFO = " << info02 << ",\nINFO < 0: if INFO = -i, the i-th argument had an illegal value.\n" << std::endl; - } + } UQ_FATAL_RC_MACRO(info02, m_env.worldRank(), "TeuchosMatrix::invertMultiplyForceLU()", - "GETRS() failed"); + "GETRS() failed"); if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In TeuchosMatrix::invertMultiply()" << ", after lapack.GETRS() - solve LU system." @@ -986,7 +986,7 @@ TeuchosMatrix::invertMultiply(const TeuchosMatrix& B) const // ---------------------------------------------- //checked 12/10/12 -void +void TeuchosMatrix::invertMultiply(const TeuchosMatrix& B, TeuchosMatrix& X) const { // Sanity Checks @@ -994,7 +994,7 @@ TeuchosMatrix::invertMultiply(const TeuchosMatrix& B, TeuchosMatrix& X) const m_env.worldRank(), "TeuchosMatrix::invertMultiply()", "Matrices B and X are incompatible"); - + UQ_FATAL_RC_MACRO((this->numRowsLocal() != X.numRowsLocal()), m_env.worldRank(), "TeuchosMatrix::invertMultiply()", @@ -1003,10 +1003,10 @@ TeuchosMatrix::invertMultiply(const TeuchosMatrix& B, TeuchosMatrix& X) const // Some local variables used within the loop. TeuchosVector b(m_env, m_map); TeuchosVector x(m_env, m_map); - + for( unsigned int j = 0; j < B.numCols(); ++j ) { b = B.getColumn(j); - //invertMultiply will only do the LU factorization once and store it. + //invertMultiply will only do the LU factorization once and store it. x = this->invertMultiply(b); X.setColumn(j,x); } @@ -1042,17 +1042,17 @@ TeuchosMatrix::invertMultiplyForceLU(const TeuchosVector& b, TeuchosVector& x) c m_env.worldRank(), "TeuchosMatrix::invertMultiply(), return void", "solution and rhs have incompatible sizes"); - - if (m_LU.numCols() == 0 && m_LU.numRows() == 0) { + + if (m_LU.numCols() == 0 && m_LU.numRows() == 0) { UQ_FATAL_TEST_MACRO((v_pivoting != NULL), m_env.worldRank(), "TeuchosMatrix::invertMultiply()", - "v_pivoting should be NULL"); + "v_pivoting should be NULL"); } - + //allocate m_LU , yes outside the if above m_LU = m_mat; - + UQ_FATAL_TEST_MACRO((m_LU.numCols() == 0 && m_LU.numRows() == 0), m_env.worldRank(), "TeuchosMatrix::invertMultiply()", @@ -1066,58 +1066,58 @@ TeuchosMatrix::invertMultiplyForceLU(const TeuchosVector& b, TeuchosVector& x) c m_env.worldRank(), "TeuchosMatrix::invertMultiply()", "malloc() for v_pivoting failed"); - + // Perform an LU factorization of matrix m_LU. Checked 12/06/12 Teuchos::LAPACK lapack; int info; - - lapack.GETRF( m_LU.numRows(), m_LU.numCols(), m_LU.values(), m_LU.stride(), v_pivoting, &info ); - + + lapack.GETRF( m_LU.numRows(), m_LU.numCols(), m_LU.values(), m_LU.stride(), v_pivoting, &info ); + if (info != 0) { std::cerr << "In TeuchosMatrix::invertMultiply()" << ", after lapack.GETRF" << ": INFO = " << info << ",\nINFO < 0: if INFO = -i, the i-th argument had an illegal value.\n" - << "INFO > 0: if INFO = i, U(i,i) is exactly zero. The factorization \n" + << "INFO > 0: if INFO = i, U(i,i) is exactly zero. The factorization \n" << "has been completed, but the factor U is exactly singular, and division \n" << "by zero will occur if it is used to solve a system of equations." << std::endl; - } - + } + UQ_FATAL_RC_MACRO(info, m_env.worldRank(), "TeuchosMatrix::invertMultiplyForceLU()", "GETRF() failed"); - - if (info > 0) + + if (info > 0) m_isSingular = true; - + // Solve the linear system. - int NRHS = 1; // NRHS: number of right hand sides, i.e., the number + int NRHS = 1; // NRHS: number of right hand sides, i.e., the number // of columns of the matrix B. In this case, vector b. - char TRANS = 'N'; // 'N': A * x= B (No transpose). Specifies the + char TRANS = 'N'; // 'N': A * x= B (No transpose). Specifies the // form of the system of equations. int info02; - - //GETRS expects the matrix to be already factored in LU and uses the + + //GETRS expects the matrix to be already factored in LU and uses the //same ipiv vector, which are the pivot indices of the LU factorization - x=b; + x=b; lapack.GETRS(TRANS, m_LU.numRows(), NRHS, m_LU.values(), m_LU.stride(), v_pivoting, &x[0],x.sizeLocal(), &info02 ); - + if (info02 != 0) { std::cerr << "In TeuchosMatrix::invertMultiply()" << ", after lapack.GETRS - solve LU system" << ": INFO = " << info02 << ",\nINFO < 0: if INFO = -i, the i-th argument had an illegal value.\n" << std::endl; - } - + } + UQ_FATAL_RC_MACRO(info02, m_env.worldRank(), "TeuchosMatrix::invertMultiplyForceLU()", - "GETRS() failed"); - + "GETRS() failed"); + return; } // --------------------------------------------------- @@ -1131,12 +1131,12 @@ TeuchosMatrix::invertMultiplyForceLU(const TeuchosVector& b, TeuchosVector& x) c * UPLO = 'U': Upper triangle of A is stored; * = 'L': Lower triangle of A is stored. * N The order of the matrix A. N >= 0. -* A (input/output) DOUBLE PRECISION array, dimension (LDA, N).On entry, the symmetric +* A (input/output) DOUBLE PRECISION array, dimension (LDA, N).On entry, the symmetric * matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the -* upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular +* upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular * part of A contains the lower triangular part of the matrix A. On exit, if JOBZ = 'V', then -* if INFO = 0, A contains the orthonormal eigenvectors of the matrix A. If JOBZ = 'N', then -* on exit the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, +* if INFO = 0, A contains the orthonormal eigenvectors of the matrix A. If JOBZ = 'N', then +* on exit the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, * including the diagonal, is destroyed. * LDA (input) INTEGER - the leading dimension of the array A. LDA >= max(1,N). * W (output) DOUBLE PRECISION array, dimension (N) @@ -1147,7 +1147,7 @@ TeuchosMatrix::invertMultiplyForceLU(const TeuchosVector& b, TeuchosVector& x) c * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO = -i, the i-th argument had an illegal value -* > 0: if INFO = i, the algorithm failed to converge; i off-diagonal elements of +* > 0: if INFO = i, the algorithm failed to converge; i off-diagonal elements of * an intermediate tridiagonal form did not converge to zero.*/ void TeuchosMatrix::eigen(TeuchosVector& eigenValues, TeuchosMatrix* eigenVectors) const @@ -1165,44 +1165,44 @@ TeuchosMatrix::eigen(TeuchosVector& eigenValues, TeuchosMatrix* eigenVectors) co "TeuchosVector::eigen()", "different input vector sizes"); } - + // At the end of execution, Lapack funcion destroys the input matrix // So, lets not use m_mat, but instead, a copy of it Teuchos::SerialDenseMatrix copy_m_mat; copy_m_mat = m_mat; Teuchos::LAPACK lapack; - int lwork = 3*n -1; + int lwork = 3*n -1; int info; - char UPLO = 'L'; + char UPLO = 'L'; double *W, *WORK; W = new double[n]; WORK = new double[lwork]; - + if (eigenVectors == NULL) { - char JOBZ = 'N';//eigenvalues only - + char JOBZ = 'N';//eigenvalues only + lapack.SYEV(JOBZ, UPLO, copy_m_mat.numRows(), copy_m_mat.values(), copy_m_mat.stride(), &W[0], &WORK[0], lwork, &info); - - for (unsigned int i=0; i< n; i++) + + for (unsigned int i=0; i< n; i++) eigenValues[i] = W[i]; - + UQ_FATAL_TEST_MACRO((info != 0), env().fullRank(), "TeuchosMatrix::eigen()", "invalid input vector size"); } else { - char JOBZ = 'V';//eigenvalues and eigenvectors - + char JOBZ = 'V';//eigenvalues and eigenvectors + lapack.SYEV(JOBZ, UPLO, copy_m_mat.numRows(), copy_m_mat.values(), copy_m_mat.stride(), &W[0], &WORK[0], lwork, &info); - + for (unsigned int i=0; i< n; i++) eigenValues[i] = W[i]; - + eigenVectors->m_mat = copy_m_mat; - } + } if (info != 0) { std::cerr << "In TeuchosMtrix::eigen()" @@ -1210,7 +1210,7 @@ TeuchosMatrix::eigen(TeuchosVector& eigenValues, TeuchosMatrix* eigenVectors) co << ",\n INFO < 0: if INFO = -i, the i-th argument had an illegal value." << "\n INFO > 0: if INFO = i, the algorithm failed to converge; i off-diagonal " << " elements of an intermediate tridiagonal form did not converge to zero." - << std::endl; + << std::endl; } return; @@ -1218,7 +1218,7 @@ TeuchosMatrix::eigen(TeuchosVector& eigenValues, TeuchosMatrix* eigenVectors) co // --------------------------------------------------- void TeuchosMatrix::largestEigen(double& eigenValue, TeuchosVector& eigenVector) const -{ +{ unsigned int n = eigenVector.sizeLocal(); UQ_FATAL_TEST_MACRO((n == 0), @@ -1226,46 +1226,46 @@ TeuchosMatrix::largestEigen(double& eigenValue, TeuchosVector& eigenVector) cons "TeuchosMatrix::largestEigen()", "invalid input vector size"); Teuchos::LAPACK lapack; - - //SYEV destroys the input matrix, so lets operate in a copy + + //SYEV destroys the input matrix, so lets operate in a copy Teuchos::SerialDenseMatrix copy_m_mat; copy_m_mat = m_mat; - int lwork = 3*n -1; + int lwork = 3*n -1; int info; - char UPLO = 'L'; - char JOBZ = 'V'; //eigenvalues and eigenvectors + char UPLO = 'L'; + char JOBZ = 'V'; //eigenvalues and eigenvectors double *W, *WORK; - + W = new double[n]; WORK = new double[lwork]; - + lapack.SYEV(JOBZ, UPLO, copy_m_mat.numRows(), copy_m_mat.values(), copy_m_mat.stride(), &W[0], &WORK[0], lwork, &info); - + if (info != 0) { std::cerr << "In TeuchosMtrix::largestEigen()" << ": INFO = " << info << ",\n INFO < 0: if INFO = -i, the i-th argument had an illegal value." << "\n INFO > 0: if INFO = i, the algorithm failed to converge; i off-diagonal " << " elements of an intermediate tridiagonal form did not converge to zero." - << std::endl; + << std::endl; } - // If INFO = 0, W contains the eigenvalues in ascending order. + // If INFO = 0, W contains the eigenvalues in ascending order. // Thus the largest eigenvalue is in W[n-1]. eigenValue = W[n-1]; - + // Eigenvector associated to the largest eigenvalue. // Stored in the n-th column of matrix copy_m_mat. for (int i=0; i< copy_m_mat.numRows(); i++) eigenVector[i] = copy_m_mat(i,n-1); - + return; } // --------------------------------------------------- void TeuchosMatrix::smallestEigen(double& eigenValue, TeuchosVector& eigenVector) const -{ +{ unsigned int n = eigenVector.sizeLocal(); UQ_FATAL_TEST_MACRO((n == 0), @@ -1273,40 +1273,40 @@ TeuchosMatrix::smallestEigen(double& eigenValue, TeuchosVector& eigenVector) con "TeuchosMatrix::smallestEigen()", "invalid input vector size"); Teuchos::LAPACK lapack; - - //SYEV destroys the input matrix, so lets operate in a copy + + //SYEV destroys the input matrix, so lets operate in a copy Teuchos::SerialDenseMatrix copy_m_mat; copy_m_mat = m_mat; - int lwork = 3*n -1; + int lwork = 3*n -1; int info; - char UPLO = 'L'; - char JOBZ = 'V';//eigenvalues and eigenvectors + char UPLO = 'L'; + char JOBZ = 'V';//eigenvalues and eigenvectors double *W, *WORK; - + W = new double[n]; WORK = new double[lwork]; - + lapack.SYEV(JOBZ, UPLO, copy_m_mat.numRows(), copy_m_mat.values(), copy_m_mat.stride(), &W[0], &WORK[0], lwork, &info); - + if (info != 0) { std::cerr << "In TeuchosMtrix::smallestEigen()" << ": INFO = " << info << ",\n INFO < 0: if INFO = -i, the i-th argument had an illegal value." << "\n INFO > 0: if INFO = i, the algorithm failed to converge; i off-diagonal " << " elements of an intermediate tridiagonal form did not converge to zero." - << std::endl; + << std::endl; } - - // If INFO = 0, W contains the eigenvalues in ascending order. + + // If INFO = 0, W contains the eigenvalues in ascending order. // Thus the smallest eigenvalue is in W[0]. eigenValue = W[0]; - + // Eigenvector associated to the smallest eigenvalue. // Stored in the n-th column of matrix copy_m_mat. for (int i=0; i< copy_m_mat.numRows(); i++) eigenVector[i] = copy_m_mat(i,0); - + return; } @@ -1373,14 +1373,14 @@ TeuchosMatrix::getColumn(unsigned int column_num, TeuchosVector& column) const // Temporary working pointer const double* temp_ptr ; - + // get the column_num- of matrix m_mat temp_ptr = m_mat[column_num]; - + // Copy column from Teuchos matrix into our TeuchosVector object for (unsigned int i=0; i< column.sizeLocal();i++) column[i] = temp_ptr[i]; - + return; } @@ -1412,10 +1412,10 @@ TeuchosMatrix::setColumn(unsigned int column_num, const TeuchosVector& column) env().fullRank(), "TeuchosMatrix::setColumn", "column vector not same size as this matrix"); - + for (unsigned int i =0; i < column.sizeLocal(); i++) m_mat(i,column_num) = column[i]; - + return; } @@ -1438,7 +1438,7 @@ TeuchosMatrix::getRow(unsigned int row_num, TeuchosVector& row) const // Copy row from Teuchos matrix into our TeuchosVector object for (unsigned int i=0; i< row.sizeLocal();i++) row[i] = m_mat(row_num,i); - + return; } @@ -1473,13 +1473,13 @@ TeuchosMatrix::setRow (const unsigned int row_num, const TeuchosVector& row) // Copy our TeuchosVector object to our Teuchos Matrix for (unsigned int i=0; i< row.sizeLocal();i++) m_mat(row_num,i) = row[i] ; - + return; } // --------------------------------------------------- // Kemelli 12/05/12 - tested -void +void TeuchosMatrix::zeroLower(bool includeDiagonal) { unsigned int nRows = this->numRowsLocal(); @@ -1511,7 +1511,7 @@ TeuchosMatrix::zeroLower(bool includeDiagonal) // --------------------------------------------------- // Kemelli 12/05/12 - tested -void +void TeuchosMatrix::zeroUpper(bool includeDiagonal) { unsigned int nRows = this->numRowsLocal(); @@ -1547,17 +1547,17 @@ TeuchosMatrix::filterSmallValues(double thresholdValue) { unsigned int nRows = this->numRowsLocal(); unsigned int nCols = this->numCols(); - + for (unsigned int i = 0; i < nRows; ++i) { for (unsigned int j = 0; j < nCols; ++j) { double aux = (*this)(i,j); // If 'thresholdValue' is negative, no values will be filtered if ((aux < 0. ) && (-thresholdValue < aux)) { (*this)(i,j) = 0.; - } + } if ((aux > 0. ) && (thresholdValue > aux)) { (*this)(i,j) = 0.; - } + } } } return; @@ -1569,14 +1569,14 @@ TeuchosMatrix::filterLargeValues(double thresholdValue) { unsigned int nRows = this->numRowsLocal(); unsigned int nCols = this->numCols(); - + for (unsigned int i = 0; i < nRows; ++i) { for (unsigned int j = 0; j < nCols; ++j) { double aux = (*this)(i,j); // If 'thresholdValue' is negative, no values will be filtered - if ( (aux < 0. ) && (-thresholdValue > aux)) + if ( (aux < 0. ) && (-thresholdValue > aux)) (*this)(i,j) = 0.; - + if ((aux > 0. ) && (thresholdValue < aux)) (*this)(i,j) = 0.; } @@ -1675,7 +1675,7 @@ TeuchosMatrix::fillWithBlocksDiagonally(const std::vector& matr for (unsigned int colId = 0; colId < nCols; ++colId) { (*this)(cumulativeRowId + rowId, cumulativeColId + colId) = (*(matrices[i]))(rowId,colId); } - } + } cumulativeRowId += nRows; cumulativeColId += nCols; } @@ -1837,7 +1837,7 @@ TeuchosMatrix::fillWithTensorProduct(const TeuchosMatrix& mat1, const TeuchosMat } } } - } + } return; } @@ -1866,7 +1866,7 @@ TeuchosMatrix::fillWithTensorProduct(const TeuchosMatrix& mat1, const TeuchosVec } } } - } + } return; } @@ -1903,7 +1903,7 @@ TeuchosMatrix::mpiSum( const MpiComm& comm, TeuchosMatrix& M_global ) const for( unsigned int i = 0; i < this->numRowsLocal(); i++ ) { for( unsigned int j = 0; j < this->numCols(); j++ ) { - k = i + j*M_global.numCols(); + k = i + j*M_global.numCols(); M_global(i,j) = global[k]; } } @@ -2198,11 +2198,11 @@ TeuchosMatrix::copy(const TeuchosMatrix& src) //dummy { this->resetLU(); unsigned int i,j, nrows=src.numRowsLocal(), ncols=src.numCols(); - + for(i=0; i< nrows ; i++) for (j = 0; j < ncols; j++) m_mat(i,j) = src(i,j); - + return; } @@ -2211,7 +2211,7 @@ void TeuchosMatrix::resetLU() { if (m_LU.numCols() >0 || m_LU.numRows() > 0) { - m_LU.reshape(0,0); //Kemelli, 12/06/12, dummy + m_LU.reshape(0,0); //Kemelli, 12/06/12, dummy } if (m_inverse) { delete m_inverse; @@ -2243,7 +2243,7 @@ TeuchosMatrix::resetLU() if (v_pivoting) { //Kemelli added 12/09/12 free(v_pivoting); v_pivoting = NULL; - + } m_signum = 0; m_isSingular = false; @@ -2299,30 +2299,30 @@ TeuchosMatrix::internalSvd() const m_svdSvec = new TeuchosVector(m_env,*m_svdColMap); m_svdVmat = new TeuchosMatrix(*m_svdSvec); m_svdVTmat = new TeuchosMatrix(*m_svdSvec); - + int minRowsCols, maxRowsCols; - + if (nRows>=nCols) { minRowsCols = nCols; maxRowsCols = nRows; } else { minRowsCols = nRows; maxRowsCols = nCols; } char jobu, jobvt; int lwork, info; double *work, *rwork; - + jobu = 'S'; jobvt = 'S'; - + lwork = 15*maxRowsCols; // Set up the work array, larger than needed. work = new double[lwork]; int aux1= 5*minRowsCols+7, aux2= 2*maxRowsCols+2*minRowsCols+1; int aux_dim; - + if (aux1>=aux2) { aux_dim = minRowsCols*aux1; } else {aux_dim = minRowsCols*aux2; } - + rwork = new double[aux_dim]; - + Teuchos::LAPACK lapack; - + lapack.GESVD(jobu,jobvt,m_mat.numRows(),m_mat.numCols(),m_mat.values(),m_mat.stride(), m_svdSvec->values(),m_svdUmat->values(),m_svdUmat->stride(),m_svdVTmat->values(), m_svdVTmat->stride(),&work[0],lwork,&rwork[0],&info); diff --git a/src/core/src/TeuchosVector.C b/src/core/src/TeuchosVector.C index 62dcc6284..b1a06b209 100644 --- a/src/core/src/TeuchosVector.C +++ b/src/core/src/TeuchosVector.C @@ -34,18 +34,18 @@ using std:: cout; using std:: endl; // --------------------------------------------------- -// default constructor ------------------------------- +// default constructor ------------------------------- TeuchosVector::TeuchosVector() : Vector() { UQ_FATAL_TEST_MACRO(true, m_env.worldRank(), "TeuchosVector::constructor(), default", - "should not be used by user"); + "should not be used by user"); }; -// constructor with dimension ----------------------- +// constructor with dimension ----------------------- TeuchosVector::TeuchosVector(const BaseEnvironment& env, const Map& map) : Vector(env,map) @@ -86,7 +86,7 @@ TeuchosVector::TeuchosVector(const BaseEnvironment& env, const Map& map, double { m_vec.size(map.NumGlobalElements()); m_vec = value; - + UQ_FATAL_TEST_MACRO((m_vec == NULL), m_env.worldRank(), "TeuchosVector::constructor(2)", @@ -147,7 +147,7 @@ TeuchosVector::TeuchosVector(const TeuchosVector& v, double d1, double d2) Vector(v.env(),v.map()) { m_vec.size(v.sizeLocal()); - + UQ_FATAL_TEST_MACRO((m_vec == NULL), m_env.worldRank(), "TeuchosVector::constructor(4), linspace", @@ -180,7 +180,7 @@ TeuchosVector::TeuchosVector(const TeuchosVector& v) // mox Vector(v.env(),v.map()) { m_vec.size(v.sizeLocal()); - + UQ_FATAL_TEST_MACRO((m_vec == NULL), m_env.worldRank(), "TeuchosVector::constructor(5), copy", @@ -204,7 +204,7 @@ TeuchosVector::TeuchosVector(const TeuchosVector& v) // mox } -// destructor -------------------------------------- +// destructor -------------------------------------- TeuchosVector::~TeuchosVector() { }; @@ -223,15 +223,15 @@ TeuchosVector& TeuchosVector::operator=(const TeuchosVector& rhs) { unsigned int size1 = m_vec.length(); unsigned int size2 = rhs.sizeLocal(); - + UQ_FATAL_TEST_MACRO(size1 != size2, // mox m_env.worldRank(), "TeuchosVector::operator=()", "the vectors do NOT have the same size.\n"); - + if (size1==size2){ for (unsigned int i=0;isizeLocal(); unsigned int size2 = rhs.sizeLocal(); - + UQ_FATAL_TEST_MACRO((size1 != size2), m_env.worldRank(), "TeuchosVector::operator/=()", @@ -297,7 +297,7 @@ TeuchosVector& TeuchosVector::operator+=(const TeuchosVector& rhs) m_env.worldRank(), "TeuchosVector::operator+=()", "the vectors do NOT have the same size.\n"); - + if (size1==size2){ for (unsigned int i = 0; i < size1; ++i) { (*this)[i] += rhs[i]; @@ -316,13 +316,13 @@ TeuchosVector& TeuchosVector::operator-=(const TeuchosVector& rhs) m_env.worldRank(), "TeuchosVector::operator-=()", "the vectors do NOT have the same size.\n"); - + if (size1==size2){ for (unsigned int i = 0; i < size1; ++i) { (*this)[i] -= rhs[i]; } } - + return *this; } @@ -348,7 +348,7 @@ unsigned int TeuchosVector::sizeLocal() const m_env.worldRank(), "TeuchosVector::sizeLocal()", "incompatible vec size"); - + return m_vec.length(); } @@ -376,26 +376,26 @@ double TeuchosVector::getMaxValue( ) const //dummy { const unsigned int size = this->sizeLocal(); std::vector aux; - + for (unsigned int i=0; isizeLocal(); std::vector aux; - + for (unsigned int i=0; isizeLocal(); std::vector vect; - + for (unsigned int i=0; isizeLocal(); std::vector vect; - + for (unsigned int i=0; i::iterator iter_min = min_element(vect.begin(), vect.end()); return distance(vect.begin(), iter_min); } @@ -429,12 +429,12 @@ void TeuchosVector::getMaxValueAndIndex( double& max_value, int& max_value_index { const unsigned int size = this->sizeLocal(); std::vector vect; - + for (unsigned int i=0; i::iterator iter_max = max_element(vect.begin(), vect.end()); - + max_value = *iter_max; max_value_index = distance(vect.begin(), iter_max); @@ -446,12 +446,12 @@ void TeuchosVector::getMinValueAndIndex( double& min_value, int& min_value_index { const unsigned int size = this->sizeLocal(); std::vector vect; - + for (unsigned int i=0; i::iterator iter_min = min_element(vect.begin(), vect.end()); - + min_value = *iter_min; min_value_index = distance(vect.begin(), iter_min); @@ -461,8 +461,8 @@ void TeuchosVector::getMinValueAndIndex( double& min_value, int& min_value_index // Norm methods ------------------------------------ // ------------------------------------------------- double TeuchosVector::norm2Sq() const -{ - return (m_vec).dot(m_vec ); +{ + return (m_vec).dot(m_vec ); } //------------------------------------------------- @@ -586,7 +586,7 @@ TeuchosVector::atLeastOneComponentBiggerOrEqualThan(const TeuchosVector& rhs) co void TeuchosVector::cwSet(double value) { (*this)=value; - + return; } @@ -597,12 +597,12 @@ void TeuchosVector::cwSet(unsigned int initialPos, const TeuchosVector& vec) m_env.worldRank(), "TeuchosVector::cwSet()", "invalid initialPos"); - + UQ_FATAL_TEST_MACRO((initialPos +vec.sizeLocal()) > this->sizeLocal(), m_env.worldRank(), "TeuchosVector::cwSet()", "invalid vec.sizeLocal()"); - + for (unsigned int i = 0; i < vec.sizeLocal(); ++i) { (*this)[initialPos+i] = vec[i]; } @@ -619,12 +619,12 @@ void TeuchosVector::cwExtract(unsigned int initialPos, TeuchosVector& vec) const m_env.worldRank(), "TeuchosVector::cwExtract()", "invalid initialPos"); - + UQ_FATAL_TEST_MACRO((initialPos +vec.sizeLocal()) > this->sizeLocal(), m_env.worldRank(), "TeuchosVector::cwExtract()", "invalid vec.sizeLocal()"); - + for (unsigned int i = 0; i < vec.sizeLocal(); ++i) { vec[i] = (*this)[initialPos+i]; } @@ -665,12 +665,12 @@ TeuchosVector::cwSetConcatenated(const TeuchosVector& v1, const TeuchosVector& v // if ( this->sizeLocal() != v1.sizeLocal() + v2.sizeLocal() ) { // std::cout << "ERROR in TeuchosVector:: cwSetConcatenated ---> the vectors' sizes are not compatible.\n"; -// cout << " in TeuchosVector:: cwSetConcatenated ---> resizing resulting vector... new size = " +// cout << " in TeuchosVector:: cwSetConcatenated ---> resizing resulting vector... new size = " // << v1.sizeLocal()+v1.sizeLocal() <sizeLocal(); ++i) { (*this)[i] = meanVec[i] + m_env.rngObject()->gaussianSample(stdDevVec[i]); - } + } return; }; @@ -729,11 +729,11 @@ void TeuchosVector::cwSetBeta(const TeuchosVector& alpha, const TeuchosVector& b "TeuchosVector::cwSetBeta()", "incompatible beta size"); - for (unsigned int i = 0; i < this->sizeLocal(); ++i) + for (unsigned int i = 0; i < this->sizeLocal(); ++i) { (*this)[i] = m_env.rngObject()->betaSample(alpha[i],beta[i]); - - if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) + + if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) { *m_env.subDisplayFile() << "In TeuchosVector::cwSetBeta()" << ": fullRank " << m_env.fullRank() @@ -815,10 +815,10 @@ TeuchosVector::copy_to_std_vector(std::vector& vec) { unsigned int size = this->sizeLocal(); vec.resize(size); - - for (unsigned int i = 0; i < size; ++i) + + for (unsigned int i = 0; i < size; ++i) vec[i] = m_vec[i]; - + return; } @@ -827,15 +827,15 @@ void TeuchosVector::copy_from_std_vector(const std::vector vec) { unsigned int size1 = vec.size(), size2= this->sizeLocal(); - + UQ_FATAL_TEST_MACRO((size1 != size2), m_env.worldRank(), "In TeuchosVector::copy_from_std_vector()", "vectors have different sizes"); - - for (unsigned int i = 0; i < size1; ++i) + + for (unsigned int i = 0; i < size1; ++i) m_vec[i] = vec[i]; - + return; } @@ -843,13 +843,13 @@ TeuchosVector::copy_from_std_vector(const std::vector vec) void TeuchosVector::sort() { std::vector vec; - - (*this).copy_to_std_vector(vec); - + + (*this).copy_to_std_vector(vec); + // using default comparison (operator <): - std::sort (vec.begin(), vec.end()); - - (*this).copy_from_std_vector(vec); + std::sort (vec.begin(), vec.end()); + + (*this).copy_from_std_vector(vec); }; // ------------------------------------------------- @@ -891,7 +891,7 @@ TeuchosVector::mpiBcast(int srcRank, const MpiComm& bcastComm) // Check that all participant nodes have the same vector size double localVectorSize = this->sizeLocal(); - double sumOfVectorSizes = 0.; + double sumOfVectorSizes = 0.; bcastComm.Allreduce((void *) &localVectorSize, (void *) &sumOfVectorSizes, (int) 1, RawValue_MPI_DOUBLE, RawValue_MPI_SUM, "TeuchosVector::mpiBcast()", "failed MPI.Allreduce() for vectorSize"); @@ -1364,14 +1364,14 @@ TeuchosVector::subWriteContents( void TeuchosVector::copy(const TeuchosVector& rhs) { - this->Vector::copy(rhs); - + this->Vector::copy(rhs); + unsigned int size1 = m_vec.length(); unsigned int size2 = rhs.sizeLocal(); - + if (size1==size2){ for (unsigned int i=0;i -int main() +int main() { QUESO::QUESO_version_print(std::cout); return 0; diff --git a/src/gp/inc/GPMSA.h b/src/gp/inc/GPMSA.h index f16695dd5..9f66653f7 100644 --- a/src/gp/inc/GPMSA.h +++ b/src/gp/inc/GPMSA.h @@ -281,7 +281,7 @@ class GPMSAFactory // The space in which the emulator (simulator) lives // const VectorSpace & m_emulatorSpace; - + // The emulator state // const V & m_emulator; diff --git a/src/gp/inc/GPMSAOptions.h b/src/gp/inc/GPMSAOptions.h index 3f4b90fff..bf5004072 100644 --- a/src/gp/inc/GPMSAOptions.h +++ b/src/gp/inc/GPMSAOptions.h @@ -1,5 +1,5 @@ //-------------------------------------------------------------------------- -// +// // QUESO - a library to support the Quantification of Uncertainty // for Estimation, Simulation and Optimization // @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Foundation, Inc. 51 Franklin Street, Fifth Floor, // Boston, MA 02110-1301 USA // //-----------------------------------------------------------------------el- diff --git a/src/gp/inc/GpmsaComputerModel.h b/src/gp/inc/GpmsaComputerModel.h index 78247e306..9ea9bb583 100644 --- a/src/gp/inc/GpmsaComputerModel.h +++ b/src/gp/inc/GpmsaComputerModel.h @@ -209,7 +209,7 @@ class GpmsaComputerModel const P_V& rho_w_vec, D_M& Rmat, unsigned int outerCounter); - + // This routine is called by formSigma_z() // This routine is called by formSigma_w_hat() void fillR_formula1_for_Sigma_w (const std::vector& xVecs, // ppp: does multiple Gs affect this routine? diff --git a/src/gp/src/ExperimentModelOptions.C b/src/gp/src/ExperimentModelOptions.C index 75514a0a3..ed694c683 100644 --- a/src/gp/src/ExperimentModelOptions.C +++ b/src/gp/src/ExperimentModelOptions.C @@ -127,7 +127,7 @@ ExperimentModelOptions::ExperimentModelOptions( ExperimentModelOptions::~ExperimentModelOptions() { if (m_optionsDesc) delete m_optionsDesc; -} +} void ExperimentModelOptions::scanOptionsValues() @@ -155,7 +155,7 @@ ExperimentModelOptions::scanOptionsValues() void ExperimentModelOptions::defineMyOptions(po::options_description& optionsDesc) const { - optionsDesc.add_options() + optionsDesc.add_options() (m_option_help.c_str(), "produce help message for experiment model options") (m_option_Gvalues.c_str(), po::value()->default_value(UQ_EXPERIMENT_MODEL_G_VALUES_ODV), "G values" ) (m_option_a_v.c_str(), po::value()->default_value(UQ_EXPERIMENT_MODEL_A_V_ODV ), "a_v" ) diff --git a/src/gp/src/GPMSA.C b/src/gp/src/GPMSA.C index 6f813ffa5..861c02532 100644 --- a/src/gp/src/GPMSA.C +++ b/src/gp/src/GPMSA.C @@ -322,7 +322,7 @@ GPMSAFactory::parameterSpace() const { return this->m_parameterSpace; } - + template const VectorSpace & GPMSAFactory::simulationOutputSpace() const diff --git a/src/gp/src/GcmJointTildeInfo.C b/src/gp/src/GcmJointTildeInfo.C index dbc13a9c0..c3885c824 100644 --- a/src/gp/src/GcmJointTildeInfo.C +++ b/src/gp/src/GcmJointTildeInfo.C @@ -329,7 +329,7 @@ template ::GcmSimulationTildeInfo( << ", etaVec_transformed.sizeLocal() = " << etaVec_transformed.sizeLocal() << std::endl; } - m_Zvec_tilde_hat_w = m_Ktildet_Ktilde_inv * (Ktildet * etaVec_transformed); + m_Zvec_tilde_hat_w = m_Ktildet_Ktilde_inv * (Ktildet * etaVec_transformed); Q_V tmpVec1(etaVec_transformed - (m_Kmat_tilde * m_Zvec_tilde_hat_w)); m_b_eta_modifier_tilde = scalarProduct(etaVec_transformed,tmpVec1) / 2.; diff --git a/src/gp/src/GpmsaComputerModel.C b/src/gp/src/GpmsaComputerModel.C index ca459841f..0d0f8f116 100644 --- a/src/gp/src/GpmsaComputerModel.C +++ b/src/gp/src/GpmsaComputerModel.C @@ -164,22 +164,22 @@ GpmsaComputerModel::GpmsaComputerModel( // --> Uses page 576-b // --> Uses R(all x's;\rho_v_i[size p_x]) and formula (2) to "each pair" of experimental input settings // --> \Sigma_v_i = (1/\lambda_v_i).I_|G_i| [X] R(...) is (n.|G_i|) x (n.|G_i|), i = 1,...,F - // --> \Sigma_v is (n.p_delta) x (n.p_delta) + // --> \Sigma_v is (n.p_delta) x (n.p_delta) // \Sigma_u: // --> Uses page 576-b // --> Uses R(all x's,one \theta;\rho_w_i[size p_x+p_t]) and formula (1) to "each pair" of experimental input settings (correlations depend only on x dimensions) // --> \Sigma_u_i = (1/\lambda_w_i).R(...) is n x n, i = 1,...,p_eta - // --> \Sigma_u is (n.p_eta) x (n.p_eta) + // --> \Sigma_u is (n.p_eta) x (n.p_eta) // \Sigma_w: // --> Uses page 575-a // --> Uses R(all x^*'s,all t^*'s;\rho_w_i[size p_x+p_t]) and formula (1) to "each pair" of input settings in the design // --> \Sigma_w_i = (1/\lambda_w_i).R(...) is m x m, i = 1,...,p_eta - // --> \Sigma_w is (m.p_eta) x (m.p_eta) + // --> \Sigma_w is (m.p_eta) x (m.p_eta) // \Sigma_u,w: // --> Uses page 577-a // --> Uses R(all x's,one \theta,all x^*'s,all t^*'s;\rho_w_i[size p_x+p_t]) and formula (1) // --> \Sigma_u,w_i = (1/\lambda_w_i).R(...) is n x m, i = 1,...,p_eta - // --> \Sigma_u,w is (n.p_eta) x (m.p_eta) + // --> \Sigma_u,w is (n.p_eta) x (m.p_eta) //******************************************************************************** m_s = new GcmSimulationInfo(*m_optionsObj, m_allOutputsAreScalar, // csri (new GcmSimulationInfo) @@ -293,7 +293,7 @@ GpmsaComputerModel::GpmsaComputerModel( if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) { *m_env.subDisplayFile() << "In GpmsaComputerModel::constructor()" - << ": m_z->m_Cmat_rank = " << m_z->m_Cmat_rank + << ": m_z->m_Cmat_rank = " << m_z->m_Cmat_rank << ", m_z->m_Cmat = " << m_z->m_Cmat << ", m_z->m_Cmat->numCols() = " << m_z->m_Cmat->numCols() << ", m_cMatIsRankDefficient = " << m_cMatIsRankDefficient @@ -958,7 +958,7 @@ GpmsaComputerModel::predictVUsAtGridPoint( m_e->m_Smat_v_hat_v_asterisk.fillWithBlocksDiagonally(0,0,m_e->m_Smat_v_hat_v_asterisk_is,true,true); m_e->m_Smat_v_hat_v_asterisk_t.fillWithTranspose(0,0,m_e->m_Smat_v_hat_v_asterisk,true,true); - here_Smat_z_hat_v_asterisk.cwSet(0.); + here_Smat_z_hat_v_asterisk.cwSet(0.); here_Smat_z_hat_v_asterisk.cwSet(0,0,m_e->m_Smat_v_hat_v_asterisk); // checar here_Smat_z_hat_v_asterisk_t.fillWithTranspose(0,0,here_Smat_z_hat_v_asterisk,true,true); @@ -1542,7 +1542,7 @@ GpmsaComputerModel::unique_vu_space() const } template -const BaseVectorRV& +const BaseVectorRV& GpmsaComputerModel::totalPriorRv() const { UQ_FATAL_TEST_MACRO(m_t == NULL, @@ -1553,7 +1553,7 @@ GpmsaComputerModel::totalPriorRv() const } template -const GenericVectorRV& +const GenericVectorRV& GpmsaComputerModel::totalPostRv() const { UQ_FATAL_TEST_MACRO(m_t == NULL, @@ -1950,7 +1950,7 @@ GpmsaComputerModel::likelihoodRoutine( // Then fill m_tmp_Smat_z // Fill m_Rmat_extra // Then fill m_tmp_Smat_z_hat - + if (m_thereIsExperimentalData) { this->formSigma_z_hat(m_s->m_tmp_1lambdaEtaVec, m_s->m_tmp_2lambdaWVec, @@ -2294,7 +2294,7 @@ GpmsaComputerModel::formSigma_z_hat( return; } - + // Case with no experimental data // checar template void @@ -2426,7 +2426,7 @@ GpmsaComputerModel::formSigma_z_hat( return; } - + template void GpmsaComputerModel::formSigma_z_tilde_hat( @@ -2594,7 +2594,7 @@ GpmsaComputerModel::formSigma_z_tilde_hat( return; } - + template void GpmsaComputerModel::formSigma_z( @@ -2627,22 +2627,22 @@ GpmsaComputerModel::formSigma_z( // --> Uses page 576-b // --> Uses R(all x's;\rho_v_i[size p_x]) and formula (2) to "each pair" of experimental input settings // --> \Sigma_v_i = (1/\lambda_v_i).I_|G_i| [X] R(...) is (n.|G_i|) x (n.|G_i|), i = 1,...,F - // --> \Sigma_v is (n.p_delta) x (n.p_delta) + // --> \Sigma_v is (n.p_delta) x (n.p_delta) // \Sigma_u: // --> Uses page 576-b // --> Uses R(all x's,one \theta;\rho_w_i[size p_x+p_t]) and formula (1) to "each pair" of experimental input settings (correlations depend only on x dimensions) // --> \Sigma_u_i = (1/\lambda_w_i).R(...) is n x n, i = 1,...,p_eta - // --> \Sigma_u is (n.p_eta) x (n.p_eta) + // --> \Sigma_u is (n.p_eta) x (n.p_eta) // \Sigma_w: // --> Uses page 575-a // --> Uses R(all x^*'s,all t^*'s;\rho_w_i[size p_x+p_t]) and formula (1) to "each pair" of input settings in the design // --> \Sigma_w_i = (1/\lambda_w_i).R(...) is m x m, i = 1,...,p_eta - // --> \Sigma_w is (m.p_eta) x (m.p_eta) + // --> \Sigma_w is (m.p_eta) x (m.p_eta) // \Sigma_u,w: // --> Uses page 577-a // --> Uses R(all x's,one \theta,all x^*'s,all t^*'s;\rho_w_i[size p_x+p_t]) and formula (1) // --> \Sigma_u,w_i = (1/\lambda_w_i).R(...) is n x m, i = 1,...,p_eta - // --> \Sigma_u,w is (n.p_eta) x (m.p_eta) + // --> \Sigma_u,w is (n.p_eta) x (m.p_eta) //******************************************************************************** unsigned int initialPos = 0; for (unsigned int i = 0; i < m_e->m_Smat_v_i_spaces.size(); ++i) { @@ -2902,22 +2902,22 @@ void // --> Uses page 576-b // --> Uses R(all x's;\rho_v_i[size p_x]) and formula (2) to "each pair" of experimental input settings // --> \Sigma_v_i = (1/\lambda_v_i).I_|G_i| [X] R(...) is (n.|G_i|) x (n.|G_i|), i = 1,...,F - // --> \Sigma_v is (n.p_delta) x (n.p_delta) + // --> \Sigma_v is (n.p_delta) x (n.p_delta) // \Sigma_u: // --> Uses page 576-b // --> Uses R(all x's,one \theta;\rho_w_i[size p_x+p_t]) and formula (1) to "each pair" of experimental input settings (correlations depend only on x dimensions) // --> \Sigma_u_i = (1/\lambda_w_i).R(...) is n x n, i = 1,...,p_eta - // --> \Sigma_u is (n.p_eta) x (n.p_eta) + // --> \Sigma_u is (n.p_eta) x (n.p_eta) // \Sigma_w: // --> Uses page 575-a // --> Uses R(all x^*'s,all t^*'s;\rho_w_i[size p_x+p_t]) and formula (1) to "each pair" of input settings in the design // --> \Sigma_w_i = (1/\lambda_w_i).R(...) is m x m, i = 1,...,p_eta - // --> \Sigma_w is (m.p_eta) x (m.p_eta) + // --> \Sigma_w is (m.p_eta) x (m.p_eta) // \Sigma_u,w: // --> Uses page 577-a // --> Uses R(all x's,one \theta,all x^*'s,all t^*'s;\rho_w_i[size p_x+p_t]) and formula (1) // --> \Sigma_u,w_i = (1/\lambda_w_i).R(...) is n x m, i = 1,...,p_eta - // --> \Sigma_u,w is (n.p_eta) x (m.p_eta) + // --> \Sigma_u,w is (n.p_eta) x (m.p_eta) //******************************************************************************** #if 0 // Case with no experimental data // checar unsigned int initialPos = 0; @@ -3203,8 +3203,8 @@ GpmsaComputerModel::fillR_formula2_for_Sigma_v( "GpmsaComputerModel::fillR_formula2_for_Sigma_v()", "Rmat.numCols() is wrong"); - S_V vecI(*(xVecs[0])); - S_V vecJ(*(xVecs[0])); + S_V vecI(*(xVecs[0])); + S_V vecJ(*(xVecs[0])); for (unsigned int i = 0; i < m_e->m_paper_n; ++i) { vecI = *(xVecs[i]); for (unsigned int j = 0; j < m_e->m_paper_n; ++j) { diff --git a/src/gp/src/GpmsaComputerModelOptions.C b/src/gp/src/GpmsaComputerModelOptions.C index 57ddf2224..0cf1430a4 100644 --- a/src/gp/src/GpmsaComputerModelOptions.C +++ b/src/gp/src/GpmsaComputerModelOptions.C @@ -179,7 +179,7 @@ GpmsaComputerModelOptions::GpmsaComputerModelOptions( GpmsaComputerModelOptions::~GpmsaComputerModelOptions() { if (m_optionsDesc) delete m_optionsDesc; -} +} void GpmsaComputerModelOptions::scanOptionsValues() diff --git a/src/gp/src/SimulationModel.C b/src/gp/src/SimulationModel.C index 630b68f95..e81333fc7 100644 --- a/src/gp/src/SimulationModel.C +++ b/src/gp/src/SimulationModel.C @@ -488,7 +488,7 @@ SimulationModel::SimulationModel( // lam=diag(S).^2/sum(diag(S).^2); // lam=cumsum(lam); // pu=sum(lam= 3)) { @@ -579,7 +579,7 @@ SimulationModel::SimulationModel( // lam=diag(S).^2/sum(diag(S).^2); // lam=cumsum(lam); // pu=sum(lam= 3)) { @@ -620,7 +620,7 @@ SimulationModel::SimulationModel( (*m_Kmat_eta) = matV_tmp * matS_tmp; - if (m_env.identifyingString() == "towerExampleToMatchGPMSA") { + if (m_env.identifyingString() == "towerExampleToMatchGPMSA") { // IMPORTANT: temporary, just to match with tower example of the Matlab version of GPMSA if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) { *m_env.subDisplayFile() << "IMPORTANT In SimulationModel::constructor()" diff --git a/src/gp/src/SimulationModelOptions.C b/src/gp/src/SimulationModelOptions.C index a8854def5..1e91fca51 100644 --- a/src/gp/src/SimulationModelOptions.C +++ b/src/gp/src/SimulationModelOptions.C @@ -155,7 +155,7 @@ SimulationModelOptions::SimulationModelOptions( SimulationModelOptions::~SimulationModelOptions() { if (m_optionsDesc) delete m_optionsDesc; -} +} void SimulationModelOptions::scanOptionsValues() @@ -187,7 +187,7 @@ SimulationModelOptions::scanOptionsValues() void SimulationModelOptions::defineMyOptions(po::options_description& optionsDesc) const { - optionsDesc.add_options() + optionsDesc.add_options() (m_option_help.c_str(), "produce help message for simulation model options") (m_option_dataOutputFileName.c_str(), po::value()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_FILE_NAME_ODV ), "name of data output file" ) (m_option_dataOutputAllowAll.c_str(), po::value()->default_value(UQ_SIMULATION_MODEL_DATA_OUTPUT_ALLOW_ALL_ODV ), "allow all or not" ) diff --git a/src/gp/src/SimulationStorage.C b/src/gp/src/SimulationStorage.C index f6b806411..f847eca01 100644 --- a/src/gp/src/SimulationStorage.C +++ b/src/gp/src/SimulationStorage.C @@ -159,7 +159,7 @@ SimulationStorage::parameterSpace() const { return m_parameterSpace; } - + template const VectorSpace& SimulationStorage::outputSpace() const diff --git a/src/misc/inc/1D1DFunction.h b/src/misc/inc/1D1DFunction.h index 65c1dc96e..c6cd40663 100644 --- a/src/misc/inc/1D1DFunction.h +++ b/src/misc/inc/1D1DFunction.h @@ -46,37 +46,37 @@ namespace QUESO { //***************************************************** /*! \class Base1D1DFunction - \brief Class for one-dimensional functions. - - Base class for one-dimensional functions. + \brief Class for one-dimensional functions. + + Base class for one-dimensional functions. */ class Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. Base1D1DFunction(double minDomainValue, double maxDomainValue); - + //! Destructor. virtual ~Base1D1DFunction(); //@} - + //! @name Mathematical methods - //@{ + //@{ //! Returns the minimum value of the domain of the (one-dimensional) function. double minDomainValue() const; - + //! Returns the maximum value of the domain of the (one-dimensional) function. double maxDomainValue() const; - + //! Returns the value of the (one-dimensional) function. See template specialization. virtual double value (double domainValue) const = 0; - + //! Returns the value of the derivative of the function. See template specialization. virtual double deriv (double domainValue) const = 0; - + //! TODO: Multiplies \c this function with \c function, and integrates it numerically. See template specialization. /*! \todo: Please, implement me!*/ virtual double multiplyAndIntegrate(const Base1D1DFunction& func, unsigned int quadratureOrder, double* resultWithMultiplicationByTAsWell) const; @@ -90,14 +90,14 @@ Base1D1DFunction { // Generic 1D->1D class //***************************************************** /*! \class Generic1D1DFunction - \brief Class for generic one-dimensional functions. - - This class implements generic one-dimensional functions. + \brief Class for generic one-dimensional functions. + + This class implements generic one-dimensional functions. */ class Generic1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. Generic1D1DFunction(double minDomainValue, double maxDomainValue, @@ -107,14 +107,14 @@ class Generic1D1DFunction : public Base1D1DFunction { //! Destructor. ~Generic1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the (one-dimensional) function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it evaluates the function at such point. */ double value(double domainValue) const; - + //! Returns the value of the derivative of the function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it returns the value of the derivative at such point. */ @@ -133,14 +133,14 @@ class Generic1D1DFunction : public Base1D1DFunction { // Constant 1D->1D class //***************************************************** /*! \class Constant1D1DFunction - \brief Class for constant one-dimensional functions. - - This class implements constant one-dimensional functions. + \brief Class for constant one-dimensional functions. + + This class implements constant one-dimensional functions. */ class Constant1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. Constant1D1DFunction(double minDomainValue, double maxDomainValue, @@ -148,7 +148,7 @@ class Constant1D1DFunction : public Base1D1DFunction { //! Destructor. ~Constant1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the constant function at point \c domainValue. @@ -156,7 +156,7 @@ class Constant1D1DFunction : public Base1D1DFunction { * and in affirmative case, it evaluates the function at such point, which is the constant * value \c constantValue passed to the constructor of this class. */ double value(double domainValue) const; - + //! Returns the value of the derivative of the constant function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it returns 0 (derivative of a constant function. */ @@ -173,20 +173,20 @@ class Constant1D1DFunction : public Base1D1DFunction { // Linear 1D->1D class //***************************************************** /*! \class Linear1D1DFunction - \brief Class for linear one-dimensional functions. - - This class implements linear one-dimensional functions. - A common linear function is the the equation of a line: \f[f(x) = y_1 + m (x - x_1), \f] - which is a linear function with slope (or rate) \f$ m \f$ and passing through the point + \brief Class for linear one-dimensional functions. + + This class implements linear one-dimensional functions. + A common linear function is the the equation of a line: \f[f(x) = y_1 + m (x - x_1), \f] + which is a linear function with slope (or rate) \f$ m \f$ and passing through the point \f$(x_1,y_1)\f$. - + This class implements a linear function such as the one describe above where the rate is given by \c rateValue, and the point is (referenceDomainValue,referenceImageValue). */ class Linear1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Constructs a linear function of constant rate of change \c rateValue which passes through * the point (x,y)=(referenceDomainValue,referenceImageValue).*/ @@ -198,17 +198,17 @@ class Linear1D1DFunction : public Base1D1DFunction { //! Destructor. ~Linear1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the linear function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it evaluates the function at such point. */ double value(double domainValue) const; - + //! Returns the value of the derivative of the linear function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, - * and in affirmative case, it returns the value of the derivative at such point (namely + * and in affirmative case, it returns the value of the derivative at such point (namely * \c m_rateValue). */ double deriv(double domainValue) const; //@} @@ -218,10 +218,10 @@ class Linear1D1DFunction : public Base1D1DFunction { //! Reference value in the function domain; \f$ x_1 \f$ in \f$ f(x) = y_1 + m (x - x_1)\f$. double m_referenceDomainValue; - + //! Reference value in the function image; \f$ y_1 \f$ in \f$ f(x) = y_1 + m (x - x_1)\f$. double m_referenceImageValue; - + //! Rate value; \f$ m\f$ in \f$f(x) = y_1 + m (x - x_1)\f$. double m_rateValue; }; @@ -230,14 +230,14 @@ class Linear1D1DFunction : public Base1D1DFunction { // PiecewiseLinear 1D->1D class //***************************************************** /*! \class PiecewiseLinear1D1DFunction - \brief Class for piecewise-linear one-dimensional functions. - - This class implements piecewise-linear one-dimensional functions. + \brief Class for piecewise-linear one-dimensional functions. + + This class implements piecewise-linear one-dimensional functions. */ class PiecewiseLinear1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. PiecewiseLinear1D1DFunction(double minDomainValue, double maxDomainValue, @@ -247,14 +247,14 @@ class PiecewiseLinear1D1DFunction : public Base1D1DFunction { //! Destructor. ~PiecewiseLinear1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the piecewise-linear function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it evaluates the function at such point. */ double value(double domainValue) const; - + //! Returns the value of the derivative of the piecewise-linear function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it returns the value of the derivative at such point. */ @@ -266,13 +266,13 @@ class PiecewiseLinear1D1DFunction : public Base1D1DFunction { //! Number of points which will be evaluated. unsigned int m_numRefValues; - + //! Reference values in the piecewise-linear function domain; \f$ x_1i \f$ in \f$ f_i(x) = y_{1i} + m_i (x - x_{1i})\f$, for each \f$ i \f$=1 .. \c m_numRefValues. std::vector m_referenceDomainValues; - + //! Reference values in the piecewise-linear function image; \f$ y_{1i} \f$ in \f$ f_i(x) = y_{1i} + m_i (x - x_{1i})\f$, for each \f$ i \f$=1 .. \c m_numRefValues. std::vector m_referenceImageValues; - + //! Rate value; \f$ m_i \f$ in \f$ f_i(x) = y_{1i} + m_i (x - x_{1i})\f$, for each \f$ i \f$=1 .. \c m_numRefValues. std::vector m_rateValues; }; @@ -281,18 +281,18 @@ class PiecewiseLinear1D1DFunction : public Base1D1DFunction { // Quadratic 1D->1D class //***************************************************** /*! \class Quadratic1D1DFunction - \brief Class for one-dimensional quadratic functions. - - This class implements quadratic one-dimensional functions. + \brief Class for one-dimensional quadratic functions. + + This class implements quadratic one-dimensional functions. A quadratic function, in mathematics, is a polynomial function of the form \f[ f(x)=ax^2+bx+c,\quad a \ne 0.\f] - The graph of a quadratic function is a parabola whose axis of symmetry is parallel + The graph of a quadratic function is a parabola whose axis of symmetry is parallel to the y-axis. */ class Quadratic1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Constructs a quadratic function in the interval [minDomainValue,maxDomainValue], * of the type: \f$ f(x)=ax^2+bx+c \f$.*/ @@ -308,13 +308,13 @@ class Quadratic1D1DFunction : public Base1D1DFunction { //@{ //! Returns the value of the quadratic function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, - * and in affirmative case, it evaluates the function at such point, namely: + * and in affirmative case, it evaluates the function at such point, namely: * imageValue = a*domainValue^2 + b*domainValue + c \f$.*/ double value(double domainValue) const; - + //! Returns the value of the derivative of the quadratic function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, - * and in affirmative case, it returns the value of the derivative at such point (namely + * and in affirmative case, it returns the value of the derivative at such point (namely * 2*a*domainValue + b . */ double deriv(double domainValue) const; //@} @@ -324,10 +324,10 @@ class Quadratic1D1DFunction : public Base1D1DFunction { //! 'Quadratic' coefficient of the quadratic function; \f$ a \f$ in \f$ f(x)=ax^2+bx+c \f$. double m_a; - + //! 'Linear' coefficient of the quadratic function; \f$ b \f$ in \f$ f(x)=ax^2+bx+c \f$. double m_b; - + //! 'Free' coefficient of the quadratic function; \f$ c \f$ in \f$ f(x)=ax^2+bx+c \f$. double m_c; }; @@ -336,64 +336,64 @@ class Quadratic1D1DFunction : public Base1D1DFunction { // Sampled 1D->1D class //***************************************************** /*! \class Sampled1D1DFunction - \brief Class for one-dimensional sampled functions. - - This class implements sampled one-dimensional functions. + \brief Class for one-dimensional sampled functions. + + This class implements sampled one-dimensional functions. A sample function is one whose values are known only at discrete values of the independent - variable; i.e., its values are only known at grid points. There are several QUESO classes - which handle grids, all derived from BaseOneDGrid. + variable; i.e., its values are only known at grid points. There are several QUESO classes + which handle grids, all derived from BaseOneDGrid. Sampled functions are usually defined by arrays. */ class Sampled1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. It should not be called by the user. Sampled1D1DFunction(); - - //! Constructor. - /*! When calling this constructor, the user provides the values of the independent variable - *(\c domainValues) and their respective values in the image set (independent variable, + + //! Constructor. + /*! When calling this constructor, the user provides the values of the independent variable + *(\c domainValues) and their respective values in the image set (independent variable, \c imageValue)*/ Sampled1D1DFunction(const std::vector& domainValues, const std::vector& imageValues); - + //! Destructor. virtual ~Sampled1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the sampled function at point \c domainValue. /*! This function checks if point \c domainValue belongs to the domain of \c this function, - * and in affirmative case, it looks for the image value associated to the domain value - * passed to the function. If there isn't any, it calculates a linear approximation for the + * and in affirmative case, it looks for the image value associated to the domain value + * passed to the function. If there isn't any, it calculates a linear approximation for the * image value of \c domainValue, considering its neighbors points in the domain.*/ virtual double value(double domainValue) const; - + //! Bogus: Derivative of the function. /*! Derivatives are not defined over sampled functions! Thus, this function simply checks if - * point \c domainValue belongs to the domain of \c this function, and in affirmative case, + * point \c domainValue belongs to the domain of \c this function, and in affirmative case, * it returns 0.*/ double deriv(double domainValue) const; //! Array of the domain values (values of the independent variable). const std::vector& domainValues() const; - + //! Array of the image values (values of the dependent variable). const std::vector& imageValues () const; - + //! Checks whether the domain value \c domainValue matches exactly one of the values in the function domain \c domainValues(). bool domainValueMatchesExactly(double domainValue) const; - + //! Sets the values of the independent (\c domainValues) and dependent (\c imageValues) variables of this sampled function. void set(const std::vector& domainValues, const std::vector& imageValues); //@} - + //! @name I/O methods //@{ - //! Prints the values of the function in Matlab/Octave format. + //! Prints the values of the function in Matlab/Octave format. virtual void printForMatlab(const BaseEnvironment& env, std::ofstream& ofsvar, const std::string& prefixName) const; //@} protected: @@ -402,7 +402,7 @@ class Sampled1D1DFunction : public Base1D1DFunction { //! Array of the values in the domain of the function (values of the independent variable). std::vector m_domainValues; - + //! Array of the values in the image of the function (values of the dependent variable). std::vector m_imageValues; }; @@ -411,34 +411,34 @@ class Sampled1D1DFunction : public Base1D1DFunction { // 'ScalarTimesFunc' 1D->1D class //***************************************************** /*! \class ScalarTimesFunc1D1DFunction - \brief Class for multiplication of a one-dimensional function by a scalar. - - This class implements the multiplication of a generic one-dimensional function + \brief Class for multiplication of a one-dimensional function by a scalar. + + This class implements the multiplication of a generic one-dimensional function (implemented through any class derived from Base1D1DFunction) by a given - scalar. + scalar. */ class ScalarTimesFunc1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. ScalarTimesFunc1D1DFunction(double scalar, const Base1D1DFunction& func); - + //! Destructor. ~ScalarTimesFunc1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the (one-dimensional) function at point \c domainValue, already multiplied by the scalar (given during construction). - /*! This function calls the value() method of the given function and multiplies its return + /*! This function calls the value() method of the given function and multiplies its return * value by the scalar passed to the constructor. */ double value(double domainValue) const; //! TODO: Returns the value of the derivative of the function multiplied by the given scalar at point \c domainValue. - /*! \todo Please, implement me! */ + /*! \todo Please, implement me! */ double deriv(double domainValue) const; //@} protected: @@ -453,34 +453,34 @@ class ScalarTimesFunc1D1DFunction : public Base1D1DFunction { // 'FuncTimesFunc' 1D->1D class //***************************************************** /*! \class FuncTimesFunc1D1DFunction - \brief Class for multiplication of a one-dimensional function by another. - - This class implements the multiplication of a generic one-dimensional function - by another (both functions may be of any type of functions derived from - Base1D1DFunction). + \brief Class for multiplication of a one-dimensional function by another. + + This class implements the multiplication of a generic one-dimensional function + by another (both functions may be of any type of functions derived from + Base1D1DFunction). */ class FuncTimesFunc1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. FuncTimesFunc1D1DFunction(const Base1D1DFunction& func1, const Base1D1DFunction& func2); - + //! Destructor. ~FuncTimesFunc1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the multiplication of a function \c func1 by another function \c func2 at the point \c domainValue, i.e. returnValue = func1(domainValue)*func2(domainValue) . - /*! This function calls the value() method of the both functions and multiplies their return + /*! This function calls the value() method of the both functions and multiplies their return * value with one another.*/ double value(double domainValue) const; - + //! TODO: Returns the value of the derivative of the function \c func1 by another function \c func2 at the point \c domainValue. /*! \todo Please, implement me! \n - * This method objective requires clarification: are we calculating either (func1*func2)' or func1'*func2'? */ + * This method objective requires clarification: are we calculating either (func1*func2)' or func1'*func2'? */ double deriv(double domainValue) const; //@} @@ -496,30 +496,30 @@ class FuncTimesFunc1D1DFunction : public Base1D1DFunction { // 'FuncPlusFunc' 1D->1D class //***************************************************** /*! \class FuncPlusFunc1D1DFunction - \brief Class for addition of a one-dimensional function with another. - - This class implements the addition of two generic one-dimensional functions - (both functions may be of any type of functions derived from Base1D1DFunction). + \brief Class for addition of a one-dimensional function with another. + + This class implements the addition of two generic one-dimensional functions + (both functions may be of any type of functions derived from Base1D1DFunction). */ class FuncPlusFunc1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. FuncPlusFunc1D1DFunction(const Base1D1DFunction& func1, const Base1D1DFunction& func2); - + //! Destructor. ~FuncPlusFunc1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the addition of function \c func1 and \c func2 evaluated at the point \c domainValue, i.e. returnValue = func1(domainValue)+func2(domainValue) . - /*! This function calls the value() method of the both functions and adds their return + /*! This function calls the value() method of the both functions and adds their return * value with one another.*/ double value(double domainValue) const; - + //! TODO: Returns the value of the derivative of the addition of two functions. /*! \todo Please, implement me! \n*/ double deriv(double domainValue) const; @@ -535,43 +535,43 @@ class FuncPlusFunc1D1DFunction : public Base1D1DFunction { // Lagrange Polynomial 1D->1D class //***************************************************** /*! \class LagrangePolynomial1D1DFunction - \brief Class for one-dimensional Lagrange polynomials. + \brief Class for one-dimensional Lagrange polynomials. */ -/*! The Lagrange interpolating polynomial of a one-dimensional function \f$ f(x) = y \f$ - * is the polynomial \f$ P(x) \f$ of degree \f$ \leq n-1 \f$ that passes through the +/*! The Lagrange interpolating polynomial of a one-dimensional function \f$ f(x) = y \f$ + * is the polynomial \f$ P(x) \f$ of degree \f$ \leq n-1 \f$ that passes through the * \f$ n \f$ points \f$ (x_1,y_1=f(x_1)), (x_2,y_2=f(x_2)), ..., (x_n,y_n=f(x_n))\f$, * and is given by: * \f[ P(x)=\sum_{j=1}^n \prod_{k=1; k\not=j}^n \frac{x-x_k}{x_j-x_k}.\f] - * + * * Written explicitly, - * \f[ P(x)=\frac{(x-x_2)(x-x_3)...(x-x_n)}{(x_1-x_2)(x_1-x_3)...(x_1-x_n)}y_1+ + * \f[ P(x)=\frac{(x-x_2)(x-x_3)...(x-x_n)}{(x_1-x_2)(x_1-x_3)...(x_1-x_n)}y_1+ \frac{(x-x_1)(x-x_3)...(x-x_n)}{(x_2-x_1)(x_2-x_3)...(x_2-x_n)}y_2+...+ \frac{(x-x_1)(x-x_2)...(x-x_(n-1))}{(x_n-x_1)(x_n-x_2)...(x_n-x_(n-1))}y_n.\f] - + * In this class, the array std::vector& positionValues stores the points * \f$ x_1, x_2, ... x_n \f$ and the array std::vector* functionValues - * stores the points \f$ y_1, y_2, ... y_n \f$ of the Lagrange polynomial. - * + * stores the points \f$ y_1, y_2, ... y_n \f$ of the Lagrange polynomial. + * * \see Archer, Branden and Weisstein, Eric W. "Lagrange Interpolating Polynomial." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html.*/ class LagrangePolynomial1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. LagrangePolynomial1D1DFunction(const std::vector& positionValues, const std::vector* functionValues); - + //! Destructor. ~LagrangePolynomial1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the Lagrange polynomial at point \c domainValue. double value(double domainValue) const; - + //! TODO: Returns the value of the derivative of the Lagrange polynomial at point \c domainValue. /*! \todo This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it returns the value of the derivative at such point. */ @@ -592,16 +592,16 @@ class LagrangePolynomial1D1DFunction : public Base1D1DFunction { * \brief Class for Lagrange polynomial basis. * * Given a set of \f$ k+1 \f$ data points \f$(x_0, y_0),\ldots,(x_j, y_j),\ldots,(x_k, y_k)\f$ - * where no two \f$ x_j \f$ are the same, the interpolation polynomial in the Lagrange form is + * where no two \f$ x_j \f$ are the same, the interpolation polynomial in the Lagrange form is * a linear combination * \f[ L(x) = \sum_{j=0}^{k} y_j \ell_j(x) \f] * of Lagrange basis polynomials * \f[ \ell_j(x) = \prod_{0\le m\le k;\, m\neq j} - \frac{x-x_m}{x_j-x_m} = \frac{(x-x_0)}{(x_j-x_0)} \cdots - \frac{(x-x_{j-1})}{(x_j-x_{j-1})} \frac{(x-x_{j+1})}{(x_j-x_{j+1})} + \frac{x-x_m}{x_j-x_m} = \frac{(x-x_0)}{(x_j-x_0)} \cdots + \frac{(x-x_{j-1})}{(x_j-x_{j-1})} \frac{(x-x_{j+1})}{(x_j-x_{j+1})} \cdots \frac{(x-x_k)}{(x_j-x_k)},\f] * where \f$ 0\le j\le k \f$.\n - * + * * This class implements the one-dimensional function (Lagrange basis) \f$ \ell_j(x) \f$. * In this class, the array std::vector& positionValues stores the points * \f$ x_1, x_2, ... x_n \f$ and the index \f$ j \f$ is stored in \c basisIndex. */ @@ -609,20 +609,20 @@ class LagrangePolynomial1D1DFunction : public Base1D1DFunction { class LagrangeBasis1D1DFunction : public Base1D1DFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. LagrangeBasis1D1DFunction(const std::vector& positionValues, unsigned int basisIndex); - + //! Destructor. ~LagrangeBasis1D1DFunction(); //@} - + //! @name Mathematical methods //@{ //! Returns the value of the Lagrange basis at point \c domainValue. double value(double domainValue) const; - + //! TODO: Returns the value of the derivative of the Lagrange basis at point \c domainValue. /*! \todo This function checks if point \c domainValue belongs to the domain of \c this function, * and in affirmative case, it returns the value of the derivative at such point. */ @@ -638,9 +638,9 @@ class LagrangeBasis1D1DFunction : public Base1D1DFunction { //---------------------------------------------------------------------- //! Calculates the integral of a 2D Gaussian KDE. -/*! This function performs numerical integration (via Hermite-Gauss quadrature, +/*! This function performs numerical integration (via Hermite-Gauss quadrature, * see GaussianHermite1DQuadrature), of a bi-variate Gaussian KDE (refer - * to ScalarSequence::subGaussian1dKde(), ArrayOfSequences::gaussianKDE(), + * to ScalarSequence::subGaussian1dKde(), ArrayOfSequences::gaussianKDE(), * or SequenceOfVectors::subGaussian1dKde(). */ template diff --git a/src/misc/inc/1DQuadrature.h b/src/misc/inc/1DQuadrature.h index 733b68928..c78409fc4 100644 --- a/src/misc/inc/1DQuadrature.h +++ b/src/misc/inc/1DQuadrature.h @@ -40,40 +40,40 @@ namespace QUESO { // Base 1D quadrature class //***************************************************** /*! \class Base1DQuadrature - \brief Base class for one-dimensional quadrature rules (numerical integration of functions). - - Base class for numerical integration via quadrature rules of one-dimensional functions. + \brief Base class for one-dimensional quadrature rules (numerical integration of functions). + + Base class for numerical integration via quadrature rules of one-dimensional functions. */ class Base1DQuadrature { public: //! @name Constructor/Destructor methods - //@{ - //! Default constructor. + //@{ + //! Default constructor. Base1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order); //! Virtual destructor. virtual ~Base1DQuadrature(); //@} - + //! @name Mathematical methods - //@{ + //@{ //! Returns the minimum value of the domain of the (one-dimensional) function. double minDomainValue() const; - - //! Returns the maximum value of the domain of the (one-dimensional) function. + + //! Returns the maximum value of the domain of the (one-dimensional) function. double maxDomainValue() const; - + //! Returns the order of the quadrature rule. unsigned int order () const; - + //! Array of the positions for the numerical integration. const std::vector& positions () const; - + //! Array of the weights used in the numerical integration. const std::vector& weights () const; - + //! A bogus method. virtual void dumbRoutine () const = 0; //@} @@ -90,26 +90,26 @@ Base1DQuadrature { // Generic 1D quadrature class //***************************************************** /*! \class Generic1DQuadrature - \brief Class for one-dimensional generic quadrature rules (numerical integration of functions). - - Class for generic quadrature rules for numerical integration of one-dimensional functions. + \brief Class for one-dimensional generic quadrature rules (numerical integration of functions). + + Class for generic quadrature rules for numerical integration of one-dimensional functions. */ class Generic1DQuadrature : public Base1DQuadrature { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. Generic1DQuadrature(double minDomainValue, double maxDomainValue, const std::vector& positions, const std::vector& weights); - + //! Destructor. ~Generic1DQuadrature(); //@} - + //! @name Mathematical methods - //@{ + //@{ //! Bogus routine. void dumbRoutine() const; //@} @@ -125,24 +125,24 @@ class Generic1DQuadrature : public Base1DQuadrature { // Uniform/Legendre 1D quadrature class //***************************************************** /*! \class UniformLegendre1DQuadrature - * \brief Class for Legendre-Gauss quadrature rule for one-dimensional functions. - * - * In a general Gaussian quadrature rule, an definite integral of \f$ f(x)\f$ is first + * \brief Class for Legendre-Gauss quadrature rule for one-dimensional functions. + * + * In a general Gaussian quadrature rule, an definite integral of \f$ f(x)\f$ is first * approximated over the interval [-1,1] by a polynomial approximable function \f$ g(x)\f$ * and a known weighting function \f$ W(x)\f$: * \f[\int_{-1}^1 f(x) \, dx = \int_{-1}^1 W(x) g(x) \, dx\f] - * Those are then approximated by a sum of function values at specified points \f$ x_i \f$ + * Those are then approximated by a sum of function values at specified points \f$ x_i \f$ * multiplied by some weights \f$ w_i \f$: * \f[ \int_{-1}^1 W(x) g(x) \, dx \approx \sum_{i=1}^n w_i g(x_i) \f] - * In the case of Gauss-Legendre quadrature, the weighting function \f$ W(x) = 1 \f$, - * so we can approximate an integral of \f$ f(x) \f$ with: + * In the case of Gauss-Legendre quadrature, the weighting function \f$ W(x) = 1 \f$, + * so we can approximate an integral of \f$ f(x) \f$ with: * \f[ \int_{-1}^1 f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i) \f] - * The abscissas for quadrature order \f$ n \f$ are given by the roots of the Legendre + * The abscissas for quadrature order \f$ n \f$ are given by the roots of the Legendre * polynomials \f$ P_n(x)\f$, which occur symmetrically about 0. The weights are * \f[ w_i = \frac{2}{(1-x_i^2)[P'_n(x_i)]^2}=\frac{2(1-x_i^2)}{(n+1)^2[P_{n+1}(x_i)]^2} \f] - * + * * Several authors give a table of abscissas and weights: - * + * @@ -162,13 +162,13 @@ class Generic1DQuadrature : public Base1DQuadrature { class UniformLegendre1DQuadrature : public Base1DQuadrature { public: //! @name Constructor/Destructor methods - //@{ - //! Default constructor. - /*! Constructs a Gaussian-Legendre quadrature of order \c order, in the interval - * [minDomainValue,maxDomainValue]. Valid values for the order of the - * quadrature rule are: 1-7, 10-12, 16. This method scales the abscissas (positions) - * of the quadrature from the interval [-1,1] to [minDomainValue,maxDomainValue], - * and the parameter \c densityIsNormalized determines whether the weights should be + //@{ + //! Default constructor. + /*! Constructs a Gaussian-Legendre quadrature of order \c order, in the interval + * [minDomainValue,maxDomainValue]. Valid values for the order of the + * quadrature rule are: 1-7, 10-12, 16. This method scales the abscissas (positions) + * of the quadrature from the interval [-1,1] to [minDomainValue,maxDomainValue], + * and the parameter \c densityIsNormalized determines whether the weights should be * scaled as well. */ UniformLegendre1DQuadrature(double minDomainValue, double maxDomainValue, @@ -177,10 +177,10 @@ class UniformLegendre1DQuadrature : public Base1DQuadrature { //! Destructor. ~UniformLegendre1DQuadrature(); //@} - + //! @name Mathematical methods - //@{ - //! A bogus method. + //@{ + //! A bogus method. void dumbRoutine() const; //@} protected: @@ -195,15 +195,15 @@ class UniformLegendre1DQuadrature : public Base1DQuadrature { // Gaussian/Hermite 1D quadrature class //***************************************************** /*! \class GaussianHermite1DQuadrature - * \brief Class for Hermite-Gauss quadrature rule for one-dimensional functions. - * - * Hermite-Gauss quadrature, also called Hermite quadrature, is a Gaussian quadrature - * over the interval \f$(-\infty,\infty)\f$ with weighting function \f$ W(x)=e^{-x^2}\f$.\n - * The abscissas for quadrature order \f$ n \f$ are given by the roots \f$ x_i \f$ of + * \brief Class for Hermite-Gauss quadrature rule for one-dimensional functions. + * + * Hermite-Gauss quadrature, also called Hermite quadrature, is a Gaussian quadrature + * over the interval \f$(-\infty,\infty)\f$ with weighting function \f$ W(x)=e^{-x^2}\f$.\n + * The abscissas for quadrature order \f$ n \f$ are given by the roots \f$ x_i \f$ of * the Hermite polynomials \f$ H_n(x)\f$, which occur symmetrically about 0.\n - * + * * The abscissas and weights can be computed analytically for small \f$ n \f$: - * + * *
    \f$ n \f$\f$ x_i \f$\f$ w_i \f$
    @@ -219,8 +219,8 @@ class UniformLegendre1DQuadrature : public Base1DQuadrature { class GaussianHermite1DQuadrature : public Base1DQuadrature { public: //! @name Constructor/Destructor methods - //@{ - //! Default constructor. + //@{ + //! Default constructor. /*! Constructs a Gaussian-Hermite quadrature of order \c order. * Valid values for the order of the quadrature rule are: 1-9, 19. * \todo: Prepare the code to include both parameters \c mean and \c stddev. */ @@ -230,10 +230,10 @@ class GaussianHermite1DQuadrature : public Base1DQuadrature { //! Destructor. ~GaussianHermite1DQuadrature(); //@} - + //! @name Mathematical methods - //@{ - //! A bogus method. + //@{ + //! A bogus method. void dumbRoutine() const; //@} protected: @@ -251,38 +251,38 @@ class GaussianHermite1DQuadrature : public Base1DQuadrature { // Wigner/Chebyshev1st 1D quadrature class //***************************************************** /*! \class WignerInverseChebyshev1st1DQuadrature - * \brief Class for first type Chebyshev-Gauss quadrature rule for one-dimensional functions. - * - * Chebyshev-Gauss quadrature, also called Chebyshev Type 1 quadrature, is a Gaussian - * quadrature over the interval [-1,1] with weighting function \f$ W(x)=\frac{1}{\sqrt{1-x^2}}\f$.\n - * The abscissas for quadrature order \f$ n \f$ are given by the roots of the Chebyshev - * polynomial of the first kind \f$ T_n(x) \f$, which occur symmetrically about 0.\n - * - * The abscissas are given explicitly by \f$ x_i=\cos[\frac{(2i-1)\pi}{2n}]\f$ and the + * \brief Class for first type Chebyshev-Gauss quadrature rule for one-dimensional functions. + * + * Chebyshev-Gauss quadrature, also called Chebyshev Type 1 quadrature, is a Gaussian + * quadrature over the interval [-1,1] with weighting function \f$ W(x)=\frac{1}{\sqrt{1-x^2}}\f$.\n + * The abscissas for quadrature order \f$ n \f$ are given by the roots of the Chebyshev + * polynomial of the first kind \f$ T_n(x) \f$, which occur symmetrically about 0.\n + * + * The abscissas are given explicitly by \f$ x_i=\cos[\frac{(2i-1)\pi}{2n}]\f$ and the * weights are \f$ w_i=\frac{\pi}{n}. \f$ - * + * * \see Weisstein, Eric W. "Chebyshev-Gauss Quadrature." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Chebyshev-GaussQuadrature.html. * \see http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature. */ class WignerInverseChebyshev1st1DQuadrature : public Base1DQuadrature { public: //! @name Constructor/Destructor methods - //@{ - //! TODO: Default constructor. - /*! \todo Constructs a Gaussian-Chebyshev quadrature (of first type) of order - * \c order, in the interval [minDomainValue,maxDomainValue]. This method + //@{ + //! TODO: Default constructor. + /*! \todo Constructs a Gaussian-Chebyshev quadrature (of first type) of order + * \c order, in the interval [minDomainValue,maxDomainValue]. This method * scales the the abscissas (positions) of the quadrature from the interval [-1,1] - * to [minDomainValue,maxDomainValue]. */ + * to [minDomainValue,maxDomainValue]. */ WignerInverseChebyshev1st1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order); //! Destructor. ~WignerInverseChebyshev1st1DQuadrature(); //@} - + //! @name Mathematical methods - //@{ - //! A bogus method. + //@{ + //! A bogus method. void dumbRoutine() const; //@} protected: @@ -297,38 +297,38 @@ class WignerInverseChebyshev1st1DQuadrature : public Base1DQuadrature { // Wigner/Chebyshev2nd 1D quadrature class //***************************************************** /*! \class WignerChebyshev2nd1DQuadrature - * \brief Class for second type Chebyshev-Gauss quadrature rule for one-dimensional functions. - * - * Chebyshev-Gauss quadrature, also called Chebyshev Type 2 quadrature, is a Gaussian - * quadrature over the interval [-1,1] with weighting function \f$ W(x)=\sqrt{1-x^2}\f$.\n - * The abscissas for quadrature order \f$ n \f$ are given by the roots of the Chebyshev - * polynomial of the \b second kind \f$ U_n(x) \f$, which occur symmetrically about 0.\n - * - * The abscissas are given explicitly by \f$ x_i=\cos[\frac{i\pi}{n+1}].\f$ + * \brief Class for second type Chebyshev-Gauss quadrature rule for one-dimensional functions. + * + * Chebyshev-Gauss quadrature, also called Chebyshev Type 2 quadrature, is a Gaussian + * quadrature over the interval [-1,1] with weighting function \f$ W(x)=\sqrt{1-x^2}\f$.\n + * The abscissas for quadrature order \f$ n \f$ are given by the roots of the Chebyshev + * polynomial of the \b second kind \f$ U_n(x) \f$, which occur symmetrically about 0.\n + * + * The abscissas are given explicitly by \f$ x_i=\cos[\frac{i\pi}{n+1}].\f$ * and all the weights are \f$ w_i=\frac{\pi}{n+1}\sin^2[\frac{i\pi}{n+1}]. \f$ - * + * * \see Weisstein, Eric W. "Gaussian Quadrature." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/GaussianQuadrature.html. * \see http://en.wikipedia.org/wiki/Chebyshev-Gauss_quadrature. */ class WignerChebyshev2nd1DQuadrature : public Base1DQuadrature { public: //! @name Constructor/Destructor methods - //@{ - //! Default constructor. + //@{ + //! Default constructor. /*! Constructs a Gaussian-Chebyshev quadrature (of second type) of order \c order, - * in the interval [minDomainValue,maxDomainValue]. This method scales the - * abscissas (positions) of the quadrature from the interval [-1,1] to - * [minDomainValue,maxDomainValue].*/ - + * in the interval [minDomainValue,maxDomainValue]. This method scales the + * abscissas (positions) of the quadrature from the interval [-1,1] to + * [minDomainValue,maxDomainValue].*/ + WignerChebyshev2nd1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order); //! Destructor. ~WignerChebyshev2nd1DQuadrature(); //@} - + //! @name Mathematical methods - //@{ + //@{ //! Bogus routine. void dumbRoutine() const; //@} diff --git a/src/misc/inc/2dArrayOfStuff.h b/src/misc/inc/2dArrayOfStuff.h index 1ca3c4372..b4796b29d 100644 --- a/src/misc/inc/2dArrayOfStuff.h +++ b/src/misc/inc/2dArrayOfStuff.h @@ -29,7 +29,7 @@ namespace QUESO { /*! \file uq2dArrayOfStuff.h * \brief A templated class for handling arrays of data - * + * * \class TwoDArray * \brief Class for handling arrays of generic data. * @@ -40,22 +40,22 @@ class TwoDArray { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. TwoDArray(unsigned int numRows, unsigned int numCols); - + //! Destructor. ~TwoDArray(); //@} //! @name Attribute methods - //@{ + //@{ //! Number of rows in the array. unsigned int numRows () const; - + //! Number of columns in the array. unsigned int numCols () const; - + //! Sets the data in a specific location. /*! This method sets the generic (templated) data \c info, in the position (i,j) * of the array. */ @@ -63,14 +63,14 @@ class TwoDArray //@} //! @name Accessor methods - //@{ + //@{ //! Returns data stored in a specific location (non-const). - /*! This non-const method returns the generic (templated) data that is stored the + /*! This non-const method returns the generic (templated) data that is stored the * position (i,j) of the array. */ T& operator ()(unsigned int i, unsigned int j); - + //! Returns data stored in a specific location (const). - /*! This const method returns the generic (templated) data that is stored the + /*! This const method returns the generic (templated) data that is stored the * position (i,j) of the array. */ const T& operator ()(unsigned int i, unsigned int j) const; //@} diff --git a/src/misc/inc/ArrayOfOneDGrids.h b/src/misc/inc/ArrayOfOneDGrids.h index b69e32990..ec12afe1a 100644 --- a/src/misc/inc/ArrayOfOneDGrids.h +++ b/src/misc/inc/ArrayOfOneDGrids.h @@ -32,12 +32,12 @@ namespace QUESO { /*!\file ArrayOfOneDGrids.h * \brief Class to accommodate arrays of one-dimensional grid. - * + * * \class ArrayOfOneDGrids * \brief Class to accommodate arrays of one-dimensional grid. - * + * * Arrays of one-dimensional grids are necessary in the calculation, for instance, of CDFs - * and MDF of vector functions (refer to BaseVectorCdf, BaseVectorMdf, and + * and MDF of vector functions (refer to BaseVectorCdf, BaseVectorMdf, and * derived classes). */ template @@ -45,34 +45,34 @@ class ArrayOfOneDGrids { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. ArrayOfOneDGrids(const char* prefix, const VectorSpace& rowSpace); - + //! Destructor. ~ArrayOfOneDGrids(); //@} - + //! @name Property methods //@{ //! Returns the (vector) space to which the row belongs to. const VectorSpace& rowSpace () const; - + //! Returns an array with the sizes of the grids. const V& sizes () const; - + //! Returns an array with the minimum position of each grid. const V& minPositions () const; - + //! Returns an array with the maximum position of each grid. const V& maxPositions () const; //@} - + //! @name Math methods //@{ // void setGrid (unsigned int rowId, // BaseOneDGrid& oneDGrid); - + //! Sets an array of uniform grids. void setUniformGrids(const V& sizesVec, const V& minPositionsVec, @@ -81,13 +81,13 @@ class ArrayOfOneDGrids //! @name Accessor methods //@{ - //! Returns the grid stored in the rowId-th position of the array of grids. + //! Returns the grid stored in the rowId-th position of the array of grids. const BaseOneDGrid& grid (unsigned int rowId) const; //@} - + //! @name I/O methods //@{ - //! Prints the values of the array of grids (points). + //! Prints the values of the array of grids (points). void print (std::ostream& os) const; friend std::ostream& operator<< (std::ostream& os, const ArrayOfOneDGrids& obj) @@ -96,7 +96,7 @@ class ArrayOfOneDGrids return os; } //@} - + private: const BaseEnvironment& m_env; std::string m_prefix; diff --git a/src/misc/inc/ArrayOfOneDTables.h b/src/misc/inc/ArrayOfOneDTables.h index 881145adb..bf54febf6 100644 --- a/src/misc/inc/ArrayOfOneDTables.h +++ b/src/misc/inc/ArrayOfOneDTables.h @@ -32,13 +32,13 @@ namespace QUESO { /*!\file ArrayOfOneDTables * \brief Class to accommodate arrays of one-dimensional tables. - * + * * \class ArrayOfOneDTables * \brief Class to accommodate arrays of one-dimensional tables. - * - * Arrays of one-dimensional tables are necessary in the calculation (storage), for - * instance, of CDFs and MDF of vector functions (refer to BaseVectorCdf, - * BaseVectorMdf, and derived classes) given the (array of) grid points + * + * Arrays of one-dimensional tables are necessary in the calculation (storage), for + * instance, of CDFs and MDF of vector functions (refer to BaseVectorCdf, + * BaseVectorMdf, and derived classes) given the (array of) grid points * (ArrayOfOneDGrids). */ @@ -47,14 +47,14 @@ class ArrayOfOneDTables { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. ArrayOfOneDTables(const char* prefix, const VectorSpace& rowSpace); //! Destructor. ~ArrayOfOneDTables(); //@} - + //! @name Math methods //@{ //! Sets the one-dimensional table. @@ -64,10 +64,10 @@ class ArrayOfOneDTables //! Returns the array located at position \c rowId of the one-dimensional table. const std::vector& oneDTable (unsigned int rowId) const; //@} - + //! @name I/O method //@{ - //! Prints the values in this array of tables. + //! Prints the values in this array of tables. /*! It prints the arrays (inner for-loop) in each position of the table (outer for-loop).*/ void print (std::ostream& os) const; //@} diff --git a/src/misc/inc/AsciiTable.h b/src/misc/inc/AsciiTable.h index e1ac7c3e4..2ec93a7ba 100644 --- a/src/misc/inc/AsciiTable.h +++ b/src/misc/inc/AsciiTable.h @@ -34,7 +34,7 @@ namespace QUESO { /*!\file AsciiTable.h * \brief Class to read ASCII values from a table. - * + * * \class AsciiTable * \brief Class for reading ASCII values from a table in a file.*/ @@ -43,7 +43,7 @@ class AsciiTable { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! This constructor reads the data from file \c fileName, checking whether the data in each * column of the file is or not a string, and whether the data in each row is or not valid.*/ @@ -55,25 +55,25 @@ class AsciiTable //! Destructor. ~AsciiTable(); //@} - + //! @name Property methods //@{ //! Returns the number of rows in the table. unsigned int numRows () const; - + //! Returns the number of columns in the table. unsigned int numCols () const; - + //! Returns the string stored in column \c j. const DistArray& stringColumn(unsigned int j) const; - + //! Returns the value (double) stored in column \c j. const V& doubleColumn(unsigned int j) const; //@} - + //! @name I/O methods //@{ - //! Prints the table. + //! Prints the table. void print (std::ostream& os) const; //@} private: diff --git a/src/misc/inc/Fft.h b/src/misc/inc/Fft.h index 3b88ce4f3..2bd5bafb7 100644 --- a/src/misc/inc/Fft.h +++ b/src/misc/inc/Fft.h @@ -36,30 +36,30 @@ namespace QUESO { */ /*! \class Fft - \brief Class for a Fast Fourier Transform (FFT) algorithm. - - This class implements a Fast Fourier Transform (FFT) algorithm. + \brief Class for a Fast Fourier Transform (FFT) algorithm. + + This class implements a Fast Fourier Transform (FFT) algorithm. Fast Fourier Transforms are efficient algorithms for calculating the discrete Fourier transform (DFT), \f[ x_j = \sum_{k=0}^{N-1} z_k \exp(-2\pi i j k / N) \f] and its inverse. - The DFT usually arises as an approximation to the continuous Fourier transform when - functions are sampled at discrete intervals in space or time. The naive evaluation of + The DFT usually arises as an approximation to the continuous Fourier transform when + functions are sampled at discrete intervals in space or time. The naive evaluation of the discrete Fourier transform is a matrix-vector multiplication \f$ Ab \f$. A general - matrix-vector multiplication takes \f$ O(N^2)\f$ operations for \f$ N \f$ data-points. - Fast Fourier transform algorithms use a divide-and-conquer strategy to factorize the + matrix-vector multiplication takes \f$ O(N^2)\f$ operations for \f$ N \f$ data-points. + Fast Fourier transform algorithms use a divide-and-conquer strategy to factorize the matrix \f$ A \f$ into smaller sub-matrices, corresponding to the integer factors of the - length \f$ N \f$. If \f$ N \f$ can be factorized into a product of integers - \f$ f_1 f_2 ... f_n \f$ then the DFT can be computed in \f$ O(N \sum f_i) \f$ operations. + length \f$ N \f$. If \f$ N \f$ can be factorized into a product of integers + \f$ f_1 f_2 ... f_n \f$ then the DFT can be computed in \f$ O(N \sum f_i) \f$ operations. For a radix-2 FFT this gives an operation count of \f$ O(N \log_2 N)\f$. - + \todo: Implement Forward Fourier Transform for Complex data. - + */ -/* If the function to be transformed is not - harmonically related to the sampling frequency, the response of an FFT looks like a sinc - function (although the integrated power is still correct). Aliasing (also known as leakage) - can be reduced by apodization using an apodization function. However, aliasing reduction +/* If the function to be transformed is not + harmonically related to the sampling frequency, the response of an FFT looks like a sinc + function (although the integrated power is still correct). Aliasing (also known as leakage) + can be reduced by apodization using an apodization function. However, aliasing reduction is at the expense of broadening the spectral response.*/ template @@ -67,7 +67,7 @@ class Fft { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default Constructor Fft(const BaseEnvironment& env); @@ -76,33 +76,33 @@ class Fft //@} //! @name Mathematical methods - //@{ + //@{ //! Calculates the forward Fourier transform (for real data. TODO: complex data). - /*! This function uses GSL function 'gsl_fft_real_transform' to compute the FFT of - * \c data, a real array (of time-ordered real data) of length \c fftSize, using a - * mixed radix decimation-in-frequency algorithm. There is no restriction on the length - * \c fftSize. Efficient modules are provided for subtransforms of length 2, 3, 4 and 5. + /*! This function uses GSL function 'gsl_fft_real_transform' to compute the FFT of + * \c data, a real array (of time-ordered real data) of length \c fftSize, using a + * mixed radix decimation-in-frequency algorithm. There is no restriction on the length + * \c fftSize. Efficient modules are provided for subtransforms of length 2, 3, 4 and 5. * Any remaining factors are computed with a slow, \f$ O(\c fftSize ^2) \f$, general- - * \c fftSize module. The caller must supply a wavetable containing trigonometric lookup - * tables and a workspace work.\n The definition of the forward Fourier transform, + * \c fftSize module. The caller must supply a wavetable containing trigonometric lookup + * tables and a workspace work.\n The definition of the forward Fourier transform, * \f$ x = FFT(z) \f$ of size \f$ N \f$ is: * \f[ x_j = \sum_{k=0}^{N-1} z_k \exp(-2\pi i j k / N). \f]*/ - void forward(const std::vector& data, + void forward(const std::vector& data, unsigned int fftSize, std::vector >& result); - + //! Calculates the inverse Fourier transform for real and complex data. - /*! This function uses GSL function 'gsl_fft_complex_inverse' to compute the FFT of - * \c data, a real array (of time-ordered real data) of length \c fftSize, using a - * mixed radix decimation-in-frequency algorithm. There is no restriction on the length - * \c fftSize. Efficient modules are provided for subtransforms of length 2, 3, 4 and 5. + /*! This function uses GSL function 'gsl_fft_complex_inverse' to compute the FFT of + * \c data, a real array (of time-ordered real data) of length \c fftSize, using a + * mixed radix decimation-in-frequency algorithm. There is no restriction on the length + * \c fftSize. Efficient modules are provided for subtransforms of length 2, 3, 4 and 5. * Any remaining factors are computed with a slow, \f$ O(fftSize^2) \f$, general- - * \c fftSize module. The caller must supply a wavetable containing trigonometric lookup - * tables and a workspace work.\n The definition of the inverse Fourier transform, + * \c fftSize module. The caller must supply a wavetable containing trigonometric lookup + * tables and a workspace work.\n The definition of the inverse Fourier transform, * \f$ x = IFFT(z)\f$ of size \f$ N \f$ is: * \f[ z_j = {1 \over N} \sum_{k=0}^{N-1} x_k \exp(2\pi i j k / N).\f] * The factor of \f$ 1/N \f$ makes this a true inverse. */ - void inverse(const std::vector& data, + void inverse(const std::vector& data, unsigned int fftSize, std::vector >& result); //@} diff --git a/src/misc/inc/OneDGrid.h b/src/misc/inc/OneDGrid.h index 0ef927429..b1d7e62ae 100644 --- a/src/misc/inc/OneDGrid.h +++ b/src/misc/inc/OneDGrid.h @@ -35,7 +35,7 @@ namespace QUESO { //***************************************************** /*!\file OneDGrid.h * \brief Classes to accommodate a one dimensional grid. - * + * * \class BaseOneDGrid * \brief Base class for accommodating one-dimensional grids.*/ @@ -46,7 +46,7 @@ template class BaseOneDGrid { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. BaseOneDGrid(const BaseEnvironment& env, const char* prefix); @@ -60,15 +60,15 @@ class BaseOneDGrid { //@} //! @name Mathematical methods //@{ - //! Grid size; the amount of points which defines the grid. See template specialization. + //! Grid size; the amount of points which defines the grid. See template specialization. virtual unsigned int size () const = 0; - + //! Finds the ID of an interval. See template specialization. - virtual unsigned int findIntervalId(const T& paramValue) const = 0; + virtual unsigned int findIntervalId(const T& paramValue) const = 0; //@} //! @name I/O methods //@{ - //! Prints the values of the grid points. + //! Prints the values of the grid points. void print (std::ostream& ofsvar) const; friend std::ostream& operator<< (std::ostream& os, const BaseOneDGrid& obj) diff --git a/src/misc/inc/StdOneDGrid.h b/src/misc/inc/StdOneDGrid.h index d30c607e0..dfe41da20 100644 --- a/src/misc/inc/StdOneDGrid.h +++ b/src/misc/inc/StdOneDGrid.h @@ -36,16 +36,16 @@ namespace QUESO { //***************************************************** /*!\class StdOneDGrid * \brief Class for accommodating standard one-dimensional grids. - * + * * This class implements a standard one-dimensional grid, which is required, for instance, - * in the evaluation of the cumulative distribution function (CDF) of a random variable. + * in the evaluation of the cumulative distribution function (CDF) of a random variable. */ template class StdOneDGrid : public BaseOneDGrid { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. StdOneDGrid(const BaseEnvironment& env, const char* prefix, @@ -53,20 +53,20 @@ class StdOneDGrid : public BaseOneDGrid { //! Destructor. ~StdOneDGrid(); //@} - + //! @name Accessor methods //@{ //! Returns the position of the i-th point in the grid. T operator[] (unsigned int i) const; //@} - + //! @name Mathematical methods //@{ //! Grid size; the amount of points which defines the grid. unsigned int size () const; - + //! Finds the ID of an interval. See template specialization. - unsigned int findIntervalId(const T& paramValue) const; + unsigned int findIntervalId(const T& paramValue) const; //@} protected: diff --git a/src/misc/inc/UniformOneDGrid.h b/src/misc/inc/UniformOneDGrid.h index 9b731d17e..4bbb12601 100644 --- a/src/misc/inc/UniformOneDGrid.h +++ b/src/misc/inc/UniformOneDGrid.h @@ -36,12 +36,12 @@ namespace QUESO { //***************************************************** /*!\class UniformOneDGrid * \brief Class for accommodating uniform one-dimensional grids.*/ - + template class UniformOneDGrid : public BaseOneDGrid { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Constructs a uniform 1D grid between \c minPosition and \c maxPosition, with \c size points.*/ UniformOneDGrid(const BaseEnvironment& env, @@ -52,21 +52,21 @@ class UniformOneDGrid : public BaseOneDGrid { //! Destructor ~UniformOneDGrid(); //@} - + //! @name Accessor methods //@{ - //! Returns the position of the i-th point in the grid. + //! Returns the position of the i-th point in the grid. T operator[] (unsigned int i) const; //@} - + //! @name Mathematical methods //@{ - //! Grid size; the amount of points that defines the grid. + //! Grid size; the amount of points that defines the grid. unsigned int size () const; - + //! Finds the ID of an interval. See template specialization. /*! This function finds to which interval the parameter value belongs to.*/ - unsigned int findIntervalId(const T& paramValue) const; + unsigned int findIntervalId(const T& paramValue) const; //@} protected: diff --git a/src/misc/src/1D1DFunction.C b/src/misc/src/1D1DFunction.C index 134ca8849..6e5035c1d 100644 --- a/src/misc/src/1D1DFunction.C +++ b/src/misc/src/1D1DFunction.C @@ -845,7 +845,7 @@ LagrangePolynomial1D1DFunction::~LagrangePolynomial1D1DFunction() { } -double +double LagrangePolynomial1D1DFunction::value(double domainValue) const { double value = 0.; @@ -880,7 +880,7 @@ LagrangePolynomial1D1DFunction::value(double domainValue) const return value; } -double +double LagrangePolynomial1D1DFunction::deriv(double domainValue) const { double value = 0.; @@ -928,7 +928,7 @@ LagrangeBasis1D1DFunction::~LagrangeBasis1D1DFunction() { } -double +double LagrangeBasis1D1DFunction::value(double domainValue) const { double scaleFactor = 1.; @@ -945,7 +945,7 @@ LagrangeBasis1D1DFunction::value(double domainValue) const return scaleFactor; } -double +double LagrangeBasis1D1DFunction::deriv(double domainValue) const { double value = 0.; diff --git a/src/misc/src/1DQuadrature.C b/src/misc/src/1DQuadrature.C index 0e4bd95b7..6980ebf3a 100644 --- a/src/misc/src/1DQuadrature.C +++ b/src/misc/src/1DQuadrature.C @@ -580,25 +580,25 @@ GaussianHermite1DQuadrature::GaussianHermite1DQuadrature( case 9: m_weights [0] = 7.64043285523e-6; - m_weights [1] = 0.00134364574678; - m_weights [2] = 0.0338743944555; - m_weights [3] = 0.240138611082; - m_weights [4] = 0.610862633735; - m_weights [5] = 0.610862633735; - m_weights [6] = 0.240138611082; - m_weights [7] = 0.0338743944555; - m_weights [8] = 0.00134364574678; + m_weights [1] = 0.00134364574678; + m_weights [2] = 0.0338743944555; + m_weights [3] = 0.240138611082; + m_weights [4] = 0.610862633735; + m_weights [5] = 0.610862633735; + m_weights [6] = 0.240138611082; + m_weights [7] = 0.0338743944555; + m_weights [8] = 0.00134364574678; m_weights [9] = 7.64043285523e-6; m_positions [0] = -3.43615911884; - m_positions [1] = -2.53273167423; - m_positions [2] = -1.7566836493; - m_positions [3] = -1.03661082979; - m_positions [4] = -0.342901327224; - m_positions [5] = 0.342901327224; - m_positions [6] = 1.03661082979; - m_positions [7] = 1.7566836493; - m_positions [8] = 2.53273167423; + m_positions [1] = -2.53273167423; + m_positions [2] = -1.7566836493; + m_positions [3] = -1.03661082979; + m_positions [4] = -0.342901327224; + m_positions [5] = 0.342901327224; + m_positions [6] = 1.03661082979; + m_positions [7] = 1.7566836493; + m_positions [8] = 2.53273167423; m_positions [9] = 3.43615911884; break; diff --git a/src/misc/src/ArrayOfOneDTables.C b/src/misc/src/ArrayOfOneDTables.C index 3e97ef63d..93f30f795 100644 --- a/src/misc/src/ArrayOfOneDTables.C +++ b/src/misc/src/ArrayOfOneDTables.C @@ -31,7 +31,7 @@ namespace QUESO { // Default constructor ------------------------------------------------- template ArrayOfOneDTables::ArrayOfOneDTables( - const char* prefix, + const char* prefix, const VectorSpace& rowSpace) : m_env (rowSpace.env()), diff --git a/src/misc/src/AsciiTable.C b/src/misc/src/AsciiTable.C index 631f92367..732ded958 100644 --- a/src/misc/src/AsciiTable.C +++ b/src/misc/src/AsciiTable.C @@ -256,7 +256,7 @@ AsciiTable::readColumnsFromFile() << std::endl; *m_env.subDisplayFile() << *this; // FIX ME: output might need to be in parallel *m_env.subDisplayFile() << std::endl; - } + } } return; diff --git a/src/misc/src/ComplexFft.C b/src/misc/src/ComplexFft.C index 27230d0e4..e4620eb04 100644 --- a/src/misc/src/ComplexFft.C +++ b/src/misc/src/ComplexFft.C @@ -30,7 +30,7 @@ namespace QUESO { template <> void Fft >::forward( - const std::vector >& data, + const std::vector >& data, unsigned int fftSize, std::vector >& forwardResult) { @@ -95,7 +95,7 @@ Fft >::forward( template <> void Fft >::inverse( - const std::vector >& data, + const std::vector >& data, unsigned int fftSize, std::vector >& inverseResult) { diff --git a/src/misc/src/Miscellaneous.C b/src/misc/src/Miscellaneous.C index bd12024e4..12b7199c6 100644 --- a/src/misc/src/Miscellaneous.C +++ b/src/misc/src/Miscellaneous.C @@ -346,7 +346,7 @@ double MiscDoubleDebugMessage( return value; } -///int CheckFilePath(const char *path) +///int CheckFilePath(const char *path) ///{ /// /// // verify parent directories in path exist (and create if not). @@ -374,7 +374,7 @@ int CheckFilePath(const char *pathname) #else const int MAX_DEPTH = 50; - + char *pathlocal; char *parents; char *dirstring; diff --git a/src/misc/src/RealFft.C b/src/misc/src/RealFft.C index 4915261fb..6a5138d14 100644 --- a/src/misc/src/RealFft.C +++ b/src/misc/src/RealFft.C @@ -32,7 +32,7 @@ namespace QUESO { template <> void Fft::forward( - const std::vector& data, + const std::vector& data, unsigned int fftSize, std::vector >& forwardResult) { @@ -100,7 +100,7 @@ Fft::forward( template <> void Fft::inverse( - const std::vector& data, + const std::vector& data, unsigned int fftSize, std::vector >& inverseResult) { diff --git a/src/misc/src/UniformOneDGrid.C b/src/misc/src/UniformOneDGrid.C index 34cfd28cc..accd671de 100644 --- a/src/misc/src/UniformOneDGrid.C +++ b/src/misc/src/UniformOneDGrid.C @@ -90,7 +90,7 @@ UniformOneDGrid::findIntervalId(const T& paramValue) const T ratio = (paramValue - m_minPosition)/(m_maxPosition - m_minPosition); unsigned int i = (unsigned int) (ratio*(m_size-1.)); - if ((i > 0 ) && + if ((i > 0 ) && ((*this)[i] > paramValue)) { i--; } diff --git a/src/stats/inc/BayesianJointPdf.h b/src/stats/inc/BayesianJointPdf.h index 17d92c585..9af069ddc 100644 --- a/src/stats/inc/BayesianJointPdf.h +++ b/src/stats/inc/BayesianJointPdf.h @@ -50,48 +50,48 @@ class BayesianJointPdf : public BaseJointPdf { public: //! @name Constructor/Destructor methods //@{ - //! Default constructor. + //! Default constructor. /*! Instantiates an object of this class given a prefix and a scalar function. - * The domain of the scalar function is assigned to the protected attribute m_domainSet, + * The domain of the scalar function is assigned to the protected attribute m_domainSet, * and the scalar fiction is also itself copied to the protected attribute m_scalarFunction.*/ BayesianJointPdf(const char* prefix, const BaseJointPdf & priorDensity, const BaseScalarFunction& likelihoodFunction, double likelihoodExponent, - const VectorSet & intersectionDomain); + const VectorSet & intersectionDomain); //! Destructor ~BayesianJointPdf(); - + //! @name Math methods //@{ //! Actual value of the PDF (scalar function). - /*! If the exponent of the likelihood function (likelihoodExponent) is zero, i.e. the likelihood is - * constant and unitary, then the actual value is the value of the prior PDF; otherwise, the actual + /*! If the exponent of the likelihood function (likelihoodExponent) is zero, i.e. the likelihood is + * constant and unitary, then the actual value is the value of the prior PDF; otherwise, the actual * value is scaled (multiplied) by a power of the value of the likelihood function.*/ double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Computes the logarithm of the value of the function. - /*! Analogously to the method actualValue(), if the exponent of the likelihood function + /*! Analogously to the method actualValue(), if the exponent of the likelihood function * (likelihoodExponent) is zero then the Logarithm of the value of the function is the logarithm of * the value of the prior PDF; otherwise, the value is scaled (added) by a power of the value of the * likelihood function.*/ double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! TODO: Computes the logarithm of the normalization factor. /*! \todo: implement me!*/ double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const; - - + + //! Sets a value to be used in the normalization style of the prior density PDF (ie, protected attribute m_priorDensity). void setNormalizationStyle (unsigned int value) const; - + //! Returns the logarithm of the last computed Prior value. Access to protected attribute m_lastComputedLogPrior. double lastComputedLogPrior () const; - + //! Returns the logarithm of the last computed likelihood value. Access to protected attribute m_lastComputedLogLikelihood. double lastComputedLogLikelihood() const; - + //@} protected: diff --git a/src/stats/inc/BetaJointPdf.h b/src/stats/inc/BetaJointPdf.h index fa30ca23a..e863ce570 100644 --- a/src/stats/inc/BetaJointPdf.h +++ b/src/stats/inc/BetaJointPdf.h @@ -66,14 +66,14 @@ class BetaJointPdf : public BaseJointPdf { //! Actual value of the Beta PDF. /*! This routine calls method lnValue() and returns the exponent of the returning value of such method.*/ double actualValue(const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Logarithm of the value of the Beta PDF. /*! If the normalization style (m_normalizationStyle) is zero, then this routine calls a environment method - * which handles basic PDFs, e.g. basicPdfs()->betaPdfActualValue() and adds the log of the normalization - * factor (m_logOfNormalizationFactor) to it; otherwise the method uses the formula: \f$ lnValue = + * which handles basic PDFs, e.g. basicPdfs()->betaPdfActualValue() and adds the log of the normalization + * factor (m_logOfNormalizationFactor) to it; otherwise the method uses the formula: \f$ lnValue = * \sum[ (alpha_i-1)*log(domainVector_i) + (beta_i-1)*log(1-domainVector_i)] + m_logOfNormalizationFactor \f$. */ double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Computes the logarithm of the normalization factor. /*! This routine calls BaseJointPdf::commonComputeLogOfNormalizationFactor().*/ double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const; diff --git a/src/stats/inc/BetaVectorRV.h b/src/stats/inc/BetaVectorRV.h index 0c3163b54..c2c34d56c 100644 --- a/src/stats/inc/BetaVectorRV.h +++ b/src/stats/inc/BetaVectorRV.h @@ -43,16 +43,16 @@ namespace QUESO { /*! * \class BetaVectorRV * \brief A class representing a vector RV constructed via Beta distribution. - * + * * This class allows the user to compute the value of a Beta PDF and to generate realizations * (samples) from it.\n - * - * The beta probability density function for a given value x and given pair of parameters - * \b a and \b b is: + * + * The beta probability density function for a given value x and given pair of parameters + * \b a and \b b is: * \f[ y=f(x|a,b)= \frac{1}{B(a,b)} x^{a-1}(1-x)^{b-1}, \f] * where B(Ā·) is the Beta function: - * \f[ B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}=\frac{(a-1)!(b-1)!}{(a+b-1)!}.\f] - * The parameters \b a and \b b must all be positive, and the values \c x must lie on the + * \f[ B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}=\frac{(a-1)!(b-1)!}{(a+b-1)!}.\f] + * The parameters \b a and \b b must all be positive, and the values \c x must lie on the * interval [0, 1]. */ @@ -65,17 +65,17 @@ class BetaVectorRV : public BaseVectorRV { //! Default Constructor /*! Construct a Beta vector RV with parameters \c a>0 and \c b>0, whose variates live in \c imageSet. * The constructor will check whether or not the data provided via \c imageSet belongs to [0,1], which - * is a requirement imposed by the Beta distribution. If this condition is not satisfied, an error + * is a requirement imposed by the Beta distribution. If this condition is not satisfied, an error * message will be displayed and the program will exit. */ BetaVectorRV(const char* prefix, const VectorSet& imageSet, const V& alpha, const V& beta); - + //! Virtual destructor virtual ~BetaVectorRV(); //@} - + //! @name I/O methods //@{ //! TODO: Prints the vector RV. diff --git a/src/stats/inc/BetaVectorRealizer.h b/src/stats/inc/BetaVectorRealizer.h index 30777f3f9..333d989b6 100644 --- a/src/stats/inc/BetaVectorRealizer.h +++ b/src/stats/inc/BetaVectorRealizer.h @@ -35,17 +35,17 @@ namespace QUESO { //***************************************************** // Beta class [R-05] //***************************************************** -/*! +/*! * \class BetaVectorRealizer * \brief A class for handling sampling from a Beta probability density distribution. * - * This class handles sampling from a Beta probability density distribution, of + * This class handles sampling from a Beta probability density distribution, of * parameters \c alpha and \c beta.*/ template class BetaVectorRealizer : public BaseVectorRealizer { public: - + //! @name Constructor/Destructor methods //@{ //! Constructor @@ -56,7 +56,7 @@ class BetaVectorRealizer : public BaseVectorRealizer { const VectorSet& unifiedImageSet, const V& alpha, const V& beta); - + //! Destructor ~BetaVectorRealizer(); //@} @@ -64,9 +64,9 @@ class BetaVectorRealizer : public BaseVectorRealizer { //! @name Realization-related methods //@{ //! Draws a realization. - /*! This function draws a realization of a Beta distribution and saves it in \c nextValues. - * It internally checks whether the image set, where the realization should be drawn, belongs - * to the interval (0, 1] - which is the range where Beta distribution is defined over. */ + /*! This function draws a realization of a Beta distribution and saves it in \c nextValues. + * It internally checks whether the image set, where the realization should be drawn, belongs + * to the interval (0, 1] - which is the range where Beta distribution is defined over. */ void realization(V& nextValues) const; //@} private: diff --git a/src/stats/inc/ConcatenatedJointPdf.h b/src/stats/inc/ConcatenatedJointPdf.h index 86b12d269..5b4713762 100644 --- a/src/stats/inc/ConcatenatedJointPdf.h +++ b/src/stats/inc/ConcatenatedJointPdf.h @@ -39,13 +39,13 @@ namespace QUESO { //***************************************************** // Concatenated probability density class [PDF-11] //***************************************************** -/*! +/*! * \class ConcatenatedJointPdf * \brief A class for handling concatenated PDFs. * - * This class allows the user to defines concatenated probability density distributions, - * i.e, two or more distinct PDFs can be concatenated into one single PDF. - * This class used, for instance, to concatenate priors from two or more RVs, where one + * This class allows the user to defines concatenated probability density distributions, + * i.e, two or more distinct PDFs can be concatenated into one single PDF. + * This class used, for instance, to concatenate priors from two or more RVs, where one * of them has a uniform distribution whereas the other one(s) has a Gaussian distribution. */ template @@ -54,43 +54,43 @@ class ConcatenatedJointPdf : public BaseJointPdf { //! @name Constructor/Destructor methods //@{ //! Constructor - /*! Concatenates two PDFs: \c density1 and \c density2 into one vector PDF, given a prefix + /*! Concatenates two PDFs: \c density1 and \c density2 into one vector PDF, given a prefix * and the concatenated domain of such PDFs.*/ ConcatenatedJointPdf(const char* prefix, const BaseJointPdf& density1, const BaseJointPdf& density2, - const VectorSet & concatenatedDomain); - + const VectorSet & concatenatedDomain); + //! Constructor /*! Concatenates a sequence of PDFs, given by: std::vector* >& densities * into one single PDF, given a prefix and the concatenated domain of such PDFs.*/ ConcatenatedJointPdf(const char* prefix, const std::vector* >& densities, - const VectorSet& concatenatedDomain); - + const VectorSet& concatenatedDomain); + //! Destructor ~ConcatenatedJointPdf(); //@} //! @name Math methods - //@{ + //@{ //! Calculates the actual values of each density. /*! The final actual value is the multiplication of all values calculated.*/ double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Calculates the logarithm of the values of each density. /*! The final logarithm value is the addition of all values calculated.*/ double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Sets the normalization style of all densities to \c value. void setNormalizationStyle(unsigned int value) const; - + //! Computes the logarithm of the normalization factor. - /*! This method calls the computeLogOfNormalizationFactor() for each one of the densities that have + /*! This method calls the computeLogOfNormalizationFactor() for each one of the densities that have * been concatenated.*/ double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const; //@} - + protected: using BaseScalarFunction::m_env; using BaseScalarFunction::m_prefix; diff --git a/src/stats/inc/ConcatenatedVectorRV.h b/src/stats/inc/ConcatenatedVectorRV.h index a82c8dc10..76069288a 100644 --- a/src/stats/inc/ConcatenatedVectorRV.h +++ b/src/stats/inc/ConcatenatedVectorRV.h @@ -43,9 +43,9 @@ namespace QUESO { /*! * \class ConcatenatedVectorRV * \brief A class representing concatenated vector RVs. - * + * * This class allows the user to concatenate two vector RV of different types and to generate realizations - * (samples) from this concatenated vector RV. It is used, for instance, to concatenate priors from two or + * (samples) from this concatenated vector RV. It is used, for instance, to concatenate priors from two or * more RVs, where one of them has a uniform distribution whereas the other one(s) has a Gaussian distribution. */ template @@ -59,26 +59,26 @@ class ConcatenatedVectorRV : public BaseVectorRV { const BaseVectorRV& rv1, const BaseVectorRV& rv2, const VectorSet& imageSet); - + //! Constructor /*! Concatenates a sequence of RVs, given by: std::vector* >& rvs * into one single vector RV, given a prefix and the image set of the resulting vector RV.*/ ConcatenatedVectorRV(const char* prefix, const std::vector* >& rvs, const VectorSet& imageSet); - + //! Virtual destructor virtual ~ConcatenatedVectorRV(); //@} - + //! @name I/O methods //@{ //! TODO: Prints the vector RV. /*! \todo: implement me!*/ void print(std::ostream& os) const; //@} - - + + private: using BaseVectorRV::m_env; using BaseVectorRV::m_prefix; diff --git a/src/stats/inc/ConcatenatedVectorRealizer.h b/src/stats/inc/ConcatenatedVectorRealizer.h index 9b291bf98..fa40f3fb5 100644 --- a/src/stats/inc/ConcatenatedVectorRealizer.h +++ b/src/stats/inc/ConcatenatedVectorRealizer.h @@ -38,16 +38,16 @@ namespace QUESO { /*! * \class ConcatenatedVectorRealizer * \brief A class for handling sampling from concatenated probability density distributions. - * - * This class allows the user draw samples from concatenated probability density distributions (two - * or more distinct probability distributions has(ve) been concatenated into one single vector RV). - * This class used, for instance, to draw realization of concatenate priors from two or more RVs, + * + * This class allows the user draw samples from concatenated probability density distributions (two + * or more distinct probability distributions has(ve) been concatenated into one single vector RV). + * This class used, for instance, to draw realization of concatenate priors from two or more RVs, * where one of them has a uniform distribution whereas the other one(s) has a Gaussian distribution. */ template class ConcatenatedVectorRealizer : public BaseVectorRealizer { public: - + //! @name Constructor/Destructor methods //@{ //! Constructor @@ -66,7 +66,7 @@ class ConcatenatedVectorRealizer : public BaseVectorRealizer { //! Destructor ~ConcatenatedVectorRealizer(); //@} - + //! @name Realization-related methods //@{ void realization(V& nextValues) const; diff --git a/src/stats/inc/ExponentialMatrixCovarianceFunction.h b/src/stats/inc/ExponentialMatrixCovarianceFunction.h index 8a5b6eed1..49a246efc 100644 --- a/src/stats/inc/ExponentialMatrixCovarianceFunction.h +++ b/src/stats/inc/ExponentialMatrixCovarianceFunction.h @@ -38,16 +38,16 @@ namespace QUESO { /*! * \class ExponentialMatrixCovarianceFunction * \brief A class for exponential covariance matrices. - * + * * This class implements squared exponential covariance matrices of the form: - * \f[ cov = a \exp{(-d^2/\sigma^2)}\f], where \f$ d=d(x,y) \f$ is the distance between two vectors, + * \f[ cov = a \exp{(-d^2/\sigma^2)}\f], where \f$ d=d(x,y) \f$ is the distance between two vectors, * \f$ \sigma^2 \f$ is the variance matrix and \f$ a \f$ is the length scale ().*/ - + template class ExponentialMatrixCovarianceFunction : public BaseMatrixCovarianceFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Instantiates an object of the class given a prefix, the domain and image sets, the variances scale factors.*/ ExponentialMatrixCovarianceFunction(const char* prefix, @@ -55,17 +55,17 @@ class ExponentialMatrixCovarianceFunction : public BaseMatrixCovarianceFunction< const VectorSet& imageSet, const Q_M& sigmas, const Q_M& as); - + //! Virtual destructor virtual ~ExponentialMatrixCovarianceFunction(); //@} - + //!@ \name Math methods //@{ //! Calculates the covariance matrix, given two parameter domains. void covMatrix(const P_V& domainVector1, const P_V& domainVector2, Q_M& imageMatrix) const; //@} - + protected: using BaseMatrixCovarianceFunction::m_env; using BaseMatrixCovarianceFunction::m_prefix; diff --git a/src/stats/inc/ExponentialScalarCovarianceFunction.h b/src/stats/inc/ExponentialScalarCovarianceFunction.h index 617d5fd02..612c6bd7e 100644 --- a/src/stats/inc/ExponentialScalarCovarianceFunction.h +++ b/src/stats/inc/ExponentialScalarCovarianceFunction.h @@ -35,39 +35,39 @@ namespace QUESO { //***************************************************** // Exponential class //***************************************************** -/*! +/*! * \class ExponentialScalarCovarianceFunction * \brief A class for exponential covariances. - * + * * This class implements squared exponential covariance functions of the form: - * \f[ cov = a \exp{(-d^2/\sigma^2)}\f], where \f$ d=d(x,y) \f$ is the distance between two points, - * \f$ \sigma^2 \f$ is the variance and \f$ a \f$ is the length scale. - * This is a stationary covariance function with smooth sample paths. Exponential covariance + * \f[ cov = a \exp{(-d^2/\sigma^2)}\f], where \f$ d=d(x,y) \f$ is the distance between two points, + * \f$ \sigma^2 \f$ is the variance and \f$ a \f$ is the length scale. + * This is a stationary covariance function with smooth sample paths. Exponential covariance * functions are largely employed in Gaussian processes. */ - + template class ExponentialScalarCovarianceFunction : public BaseScalarCovarianceFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Instantiates an object of the class given a prefix, the domain set, the variance and a scale factor. */ ExponentialScalarCovarianceFunction(const char* prefix, const VectorSet& basicDomainSet, double sigma, double a); - + //! Virtual destructor. virtual ~ExponentialScalarCovarianceFunction(); - + //! @name Math methods //@{ //! Calculates the value of the exponential covariance function. - /*! The value of the exponential covariance function is: \f$ cov= a exp (-d^2/sigma)\f$, with + /*! The value of the exponential covariance function is: \f$ cov= a exp (-d^2/sigma)\f$, with * \f$ d= \sqrt{(domainVector1 - domainVector1)^2} \f$*/ double value(const V& domainVector1, const V& domainVector2) const; //@} - + protected: using BaseScalarCovarianceFunction::m_env; using BaseScalarCovarianceFunction::m_prefix; diff --git a/src/stats/inc/FiniteDistribution.h b/src/stats/inc/FiniteDistribution.h index df706bb28..a24c33ee1 100644 --- a/src/stats/inc/FiniteDistribution.h +++ b/src/stats/inc/FiniteDistribution.h @@ -34,10 +34,10 @@ namespace QUESO { * * \class FiniteDistribution * \brief A templated class for a finite distribution. - * - * Unordered, discrete distribution, whose weights must be nonnegative, and are treated as unnormalized + * + * Unordered, discrete distribution, whose weights must be nonnegative, and are treated as unnormalized * probabilities.\n - * + * * TODO: Describe me better!*/ class FiniteDistribution { @@ -51,22 +51,22 @@ class FiniteDistribution { //! Virtual destructor virtual ~FiniteDistribution(); //@} - + //! @name Misc methods //@{ - //! Environment; access to protected attribute m_env. + //! Environment; access to protected attribute m_env. const BaseEnvironment& env () const; //@} - + //! @name Statistical methods //@{ //! Weights. const std::vector& weights() const; - + //! Samples. unsigned int sample () const; //@} - + protected: const BaseEnvironment& m_env; std::string m_prefix; diff --git a/src/stats/inc/GammaJointPdf.h b/src/stats/inc/GammaJointPdf.h index 8a97960c3..a7dd9a8c9 100644 --- a/src/stats/inc/GammaJointPdf.h +++ b/src/stats/inc/GammaJointPdf.h @@ -66,15 +66,15 @@ class GammaJointPdf : public BaseJointPdf { //! Actual value of the Gamma PDF. /*! This routine calls method lnValue() and returns the exponent of the returning value of such method.*/ double actualValue(const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Logarithm of the value of the Gamma PDF. /*! If the normalization style (m_normalizationStyle) is zero, then this routine calls a environment method - * which handles basic PDFs, e.g. basicPdfs()->gammaPdfActualValue() and adds the log of the normalization - * factor (m_logOfNormalizationFactor) to it; otherwise the method uses the formula: \f$ lnValue = + * which handles basic PDFs, e.g. basicPdfs()->gammaPdfActualValue() and adds the log of the normalization + * factor (m_logOfNormalizationFactor) to it; otherwise the method uses the formula: \f$ lnValue = * \sum[ (a_i-1)*log(domainVector_i) -domainVector_i/b_i + m_logOfNormalizationFactor \f$, where a and b * are the parameters of the Gamma PDF. */ double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Computes the logarithm of the normalization factor. /*! This routine calls BaseJointPdf::commonComputeLogOfNormalizationFactor().*/ double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const; diff --git a/src/stats/inc/GammaVectorRV.h b/src/stats/inc/GammaVectorRV.h index 107579b01..5645bc1dc 100644 --- a/src/stats/inc/GammaVectorRV.h +++ b/src/stats/inc/GammaVectorRV.h @@ -43,28 +43,28 @@ namespace QUESO { /*! * \class GammaVectorRV * \brief A class representing a vector RV constructed via Gamma distribution. - * + * * This class allows the user to compute the value of a Gamma PDF and to generate realizations * (samples) from it.\n - * - * The gamma probability density function for a given value x and given pair of parameters - * \b a and \b b is: + * + * The gamma probability density function for a given value x and given pair of parameters + * \b a and \b b is: * \f[ y=f(x|a,b)= \frac{1}{b^{a}\Gamma(a)} x^{a-1} e^{\frac{x}{b}}, \f] * where \f$ \Gamma(.) \f$ is the Gamma function: - * \f[ B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}=\frac{(a-1)!(b-1)!}{(a+b-1)!}.\f] - * The parameters \b a and \b b must all be positive, and the values \c x must lie on the + * \f[ B(a,b)=\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}=\frac{(a-1)!(b-1)!}{(a+b-1)!}.\f] + * The parameters \b a and \b b must all be positive, and the values \c x must lie on the * interval \f$ (0, \infty)\f$. */ - + template class GammaVectorRV : public BaseVectorRV { public: - + //! @name Constructor/Destructor methods //@{ //! Default Constructor /*! Construct a Gamma vector RV with parameters \c a>0 and \c b>0, whose variates live in \c imageSet. - * The constructor will check whether or not the data provided via \c imageSet belongs to - * \f$ (0, \infty)\f$, which is a requirement imposed by the Gamma distribution. If this condition + * The constructor will check whether or not the data provided via \c imageSet belongs to + * \f$ (0, \infty)\f$, which is a requirement imposed by the Gamma distribution. If this condition * is not satisfied, an error message will be displayed and the program will exit. */ GammaVectorRV(const char* prefix, const VectorSet& imageSet, @@ -73,14 +73,14 @@ class GammaVectorRV : public BaseVectorRV { //! Virtual destructor virtual ~GammaVectorRV(); //@} - + //! @name I/O methods //@{ //! TODO: Prints the vector RV. /*! \todo: implement me!*/ void print(std::ostream& os) const; //@} - + private: using BaseVectorRV::m_env; using BaseVectorRV::m_prefix; diff --git a/src/stats/inc/GammaVectorRealizer.h b/src/stats/inc/GammaVectorRealizer.h index eae20f95e..0994adef1 100644 --- a/src/stats/inc/GammaVectorRealizer.h +++ b/src/stats/inc/GammaVectorRealizer.h @@ -35,16 +35,16 @@ namespace QUESO { //***************************************************** // Gamma class [R-06] //***************************************************** -/*! +/*! * \class GammaVectorRealizer * \brief A class for handling sampling from a Gamma probability density distribution. * - * This class handles sampling from a Gamma probability density distribution, of + * This class handles sampling from a Gamma probability density distribution, of * parameters \c a and \c b.*/ template class GammaVectorRealizer : public BaseVectorRealizer { public: - + //! @name Constructor/Destructor methods //@{ //! Constructor @@ -55,17 +55,17 @@ class GammaVectorRealizer : public BaseVectorRealizer { const VectorSet& unifiedImageSet, const V& a, const V& b); - + //! Destructor ~GammaVectorRealizer(); //@} - + //! @name Realization-related methods //@{ //! Draws a realization. - /*! This function draws a realization of a Gamma distribution and saves it in \c nextValues. - * It internally checks whether the image set, where the realization should be drawn, belongs - * to the interval (0, infinity) - which is the range where Gamma distribution is defined over. */ + /*! This function draws a realization of a Gamma distribution and saves it in \c nextValues. + * It internally checks whether the image set, where the realization should be drawn, belongs + * to the interval (0, infinity) - which is the range where Gamma distribution is defined over. */ void realization(V& nextValues) const; private: diff --git a/src/stats/inc/GaussianJointPdf.h b/src/stats/inc/GaussianJointPdf.h index a38ed59c2..86bfb8b77 100644 --- a/src/stats/inc/GaussianJointPdf.h +++ b/src/stats/inc/GaussianJointPdf.h @@ -39,7 +39,7 @@ namespace QUESO { //***************************************************** // Gaussian probability density class [PDF-03] //***************************************************** -/*! +/*! * \class GaussianJointPdf * \brief A class for handling Gaussian joint PDFs. * @@ -50,17 +50,17 @@ class GaussianJointPdf : public BaseJointPdf { public: //! @name Constructor/Destructor methods //@{ - //! Constructor + //! Constructor /*! Constructs a new object, given a prefix and the domain of the PDF, a vector of mean - * values, \c lawExpVector, and a vector of covariance values \c lawVarVector (an - * alternative representation for a diagonal covariance matrix). */ + * values, \c lawExpVector, and a vector of covariance values \c lawVarVector (an + * alternative representation for a diagonal covariance matrix). */ GaussianJointPdf(const char* prefix, const VectorSet& domainSet, const V& lawExpVector, const V& lawVarVector); //! Constructor /*! Constructs a new object, given a prefix and the image set of the vector realizer, a - * vector of mean values, \c lawExpVector, and a covariance matrix, \c lawCovMatrix. */ + * vector of mean values, \c lawExpVector, and a covariance matrix, \c lawCovMatrix. */ GaussianJointPdf(const char* prefix, const VectorSet& domainSet, const V& lawExpVector, @@ -68,40 +68,40 @@ class GaussianJointPdf : public BaseJointPdf { //! Destructor ~GaussianJointPdf(); //@} - + //! @name Math methods //@{ - + //! Actual value of the Gaussian PDF: /*! This method calls lnValue() and applies the exponential to it.*/ double actualValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Logarithm of the value of the Gaussian PDF (scalar function). /*! The ln(value) comes from a summation of the Gaussian density: * \f[ lnValue =- \sum_i \frac{1}{\sqrt{|covMatrix|} \sqrt{2 \pi}} exp(-\frac{(domainVector_i - lawExpVector_i)* covMatrix^{-1}* (domainVector_i - lawExpVector_i) }{2}, \f] * where the \f$ covMatrix \f$ may recovered via \c this->lawVarVector(), in case of diagonal * matrices or via \c this->m_lawCovMatrix, otherwise.*/ double lnValue (const V& domainVector, const V* domainDirection, V* gradVector, M* hessianMatrix, V* hessianEffect) const; - + //! Computes the logarithm of the normalization factor. /*! This routine calls BaseJointPdf::commonComputeLogOfNormalizationFactor().*/ double computeLogOfNormalizationFactor(unsigned int numSamples, bool updateFactorInternally) const; - - //! Updates the mean with the new value \c newLawExpVector. + + //! Updates the mean with the new value \c newLawExpVector. /*! This method deletes old expected values (allocated at construction or last call to this method).*/ void updateLawExpVector(const V& newLawExpVector); - + //! Updates the lower triangular matrix from Cholesky decomposition of the covariance matrix to the new value \c newLowerCholLawCovMatrix. /*! This method deletes old expected values (allocated at construction or last call to this method).*/ void updateLawCovMatrix(const M& newLawCovMatrix); - - //! Returns the covariance matrix; access to protected attribute m_lawCovMatrix. + + //! Returns the covariance matrix; access to protected attribute m_lawCovMatrix. const M& lawCovMatrix () const; - //! Access to the vector of mean values and private attribute: m_lawExpVector. + //! Access to the vector of mean values and private attribute: m_lawExpVector. const V& lawExpVector() const; - - //! Access to the vector of variance values and private attribute: m_lawVarVector. + + //! Access to the vector of variance values and private attribute: m_lawVarVector. const V& lawVarVector() const; //@} protected: diff --git a/src/stats/inc/GaussianVectorCdf.h b/src/stats/inc/GaussianVectorCdf.h index ac05d19c6..91a4212cd 100644 --- a/src/stats/inc/GaussianVectorCdf.h +++ b/src/stats/inc/GaussianVectorCdf.h @@ -37,22 +37,22 @@ namespace QUESO { //***************************************************** // Gaussian cumulative distribution function class //***************************************************** -/*! +/*! * \class GaussianVectorCdf * \brief TODO: A class for handling Gaussian CDFs. * - * This class \b will implement a Gaussian vector cumulative distribution function (CDF). + * This class \b will implement a Gaussian vector cumulative distribution function (CDF). * \todo: Implement me! */ template class GaussianVectorCdf : public BaseVectorCdf { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! TODO: Constructor. /*! \todo: implement me! This method calls commonConstructor() which is not yet implemented. - * Instantiates an object of the class given a prefix, the support of the related-PDF, and - * the domain mean and expected values. + * Instantiates an object of the class given a prefix, the support of the related-PDF, and + * the domain mean and expected values. */ GaussianVectorCdf(const char* prefix, const VectorSet& pdfSupport, @@ -60,7 +60,7 @@ class GaussianVectorCdf : public BaseVectorCdf { const V& domainVarianceValues); //! TODO: Constructor. /*! \todo: implement me! This method calls commonConstructor() which is not yet implemented. - * Instantiates an object of the class given a prefix, the support of the related-PDF, and + * Instantiates an object of the class given a prefix, the support of the related-PDF, and * the domain mean values and covariance matrix.*/ GaussianVectorCdf(const char* prefix, const VectorSet& pdfSupport, @@ -72,14 +72,14 @@ class GaussianVectorCdf : public BaseVectorCdf { //! @name Mathematical method //@{ - //! TODO: Returns the values of the vector CDF at each element of \c paramValues. + //! TODO: Returns the values of the vector CDF at each element of \c paramValues. /*! \todo: implement me!*/ void values(const V& paramValues, V& cdfVec) const; //@} - + //! @name I/O method - //@{ - //! TODO: Prints the vector CDF. + //@{ + //! TODO: Prints the vector CDF. /*! \todo: implement me!*/ void print (std::ostream& os) const; //@} diff --git a/src/stats/inc/GaussianVectorMdf.h b/src/stats/inc/GaussianVectorMdf.h index d3d40b00b..f8408b1af 100644 --- a/src/stats/inc/GaussianVectorMdf.h +++ b/src/stats/inc/GaussianVectorMdf.h @@ -36,7 +36,7 @@ namespace QUESO { //***************************************************** // Gaussian marginal density function class //***************************************************** -/*! +/*! * \class GaussianVectorMdf * \brief TODO: A class for handling Gaussian MDFs. * @@ -47,10 +47,10 @@ template class GaussianVectorMdf : public BaseVectorMdf { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! TODO: Constructor. /*! \todo: implement me! This method calls commonConstructor() which is not yet implemented. - * Instantiates an object of the class given a prefix, the domain set, and the domain mean + * Instantiates an object of the class given a prefix, the domain set, and the domain mean * and expected values. */ GaussianVectorMdf(const char* prefix, const VectorSet& domainSet, @@ -58,7 +58,7 @@ class GaussianVectorMdf : public BaseVectorMdf { const V& domainVarianceValues); //! TODO: Constructor. /*! \todo: implement me! This method calls commonConstructor() which is not yet implemented. - * Instantiates an object of the class given a prefix, the domain set, and the domain mean + * Instantiates an object of the class given a prefix, the domain set, and the domain mean * and covariance matrix. */ GaussianVectorMdf(const char* prefix, const VectorSet& domainSet, @@ -70,14 +70,14 @@ class GaussianVectorMdf : public BaseVectorMdf { //! @name Mathematical method //@{ - //! TODO: Returns the values of the vector CDF at each element of \c paramValues. + //! TODO: Returns the values of the vector CDF at each element of \c paramValues. /*! \todo: implement me!*/ void values(const V& paramValues, V& mdfVec) const; //@} - + //! @name I/O method - //@{ - //! TODO: Prints the vector CDF. + //@{ + //! TODO: Prints the vector CDF. /*! \todo: implement me!*/ void print (std::ostream& os) const; //@} diff --git a/src/stats/inc/GaussianVectorRV.h b/src/stats/inc/GaussianVectorRV.h index ddff5edb8..4184480c2 100644 --- a/src/stats/inc/GaussianVectorRV.h +++ b/src/stats/inc/GaussianVectorRV.h @@ -44,15 +44,15 @@ namespace QUESO { /*! * \class GaussianVectorRV * \brief A class representing a Gaussian vector RV. - * + * * This class allows the user to compute the value of a Gaussian PDF and to generate realizations * (samples) from it. - * - * In probability theory, the normal (or Gaussian) distribution is a continuous probability + * + * In probability theory, the normal (or Gaussian) distribution is a continuous probability * distribution, defined by the formula: * \f[ f(x| \mu,\sigma) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{(x-\mu)^2}{2\sigma^2} }. \f] - * - * The parameter \f$ \mu \f$ in this formula is the mean or expectation of the distribution (and also + * + * The parameter \f$ \mu \f$ in this formula is the mean or expectation of the distribution (and also * its median and mode). The parameter \f$ \sigma \f$ is its standard deviation; its variance is therefore * \f$ \sigma^2 \f$ . */ @@ -61,22 +61,22 @@ class GaussianVectorRV : public BaseVectorRV { public: //! @name Constructor/Destructor methods //@{ - //! Constructor + //! Constructor /*! Construct a Gaussian vector RV with mean \c lawExpVector and diagonal covariance matrix * \c lawVarVector whose variates live in \c imageSet.*/ GaussianVectorRV(const char* prefix, const VectorSet& imageSet, const V& lawExpVector, const V& lawVarVector); - - //! Constructor + + //! Constructor /*! Construct a Gaussian vector RV with mean \c lawExpVector and covariance matrix * \c lawCovMatrix whose variates live in \c imageSet.*/ GaussianVectorRV(const char* prefix, const VectorSet& imageSet, const V& lawExpVector, const M& lawCovMatrix); - + //! Virtual destructor virtual ~GaussianVectorRV(); //@} @@ -85,20 +85,20 @@ class GaussianVectorRV : public BaseVectorRV { //@{ //! Updates the vector that contains the mean values. void updateLawExpVector(const V& newLawExpVector); - + //! Updates the covariance matrix. - /*! This method tries to use Cholesky decomposition; and if it fails, the method then + /*! This method tries to use Cholesky decomposition; and if it fails, the method then * calls a SVD decomposition.*/ void updateLawCovMatrix(const M& newLawCovMatrix); //@} - + //! @name I/O methods //@{ //! TODO: Prints the vector RV. /*! \todo: implement me!*/ void print(std::ostream& os) const; //@} - + private: using BaseVectorRV::m_env; using BaseVectorRV::m_prefix; diff --git a/src/stats/inc/GaussianVectorRealizer.h b/src/stats/inc/GaussianVectorRealizer.h index 5f1b8c60c..793e7eb96 100644 --- a/src/stats/inc/GaussianVectorRealizer.h +++ b/src/stats/inc/GaussianVectorRealizer.h @@ -35,7 +35,7 @@ namespace QUESO { //***************************************************** // Gaussian class [R-03] //***************************************************** -/*! +/*! * \class GaussianVectorRealizer * \brief A class for handling sampling from Gaussian probability density distributions. * @@ -44,13 +44,13 @@ namespace QUESO { template class GaussianVectorRealizer : public BaseVectorRealizer { public: - + //! @name Constructor/Destructor methods //@{ //! Constructor /*! Constructs a new object, given a prefix and the image set of the vector realizer, a - * vector of mean values, \c lawExpVector, and a lower triangular matrix resulting from - * Cholesky decomposition of the covariance matrix, \c lowerCholLawCovMatrix. */ + * vector of mean values, \c lawExpVector, and a lower triangular matrix resulting from + * Cholesky decomposition of the covariance matrix, \c lowerCholLawCovMatrix. */ GaussianVectorRealizer(const char* prefix, const VectorSet& unifiedImageSet, const V& lawExpVector, // vector of mean values @@ -58,9 +58,9 @@ class GaussianVectorRealizer : public BaseVectorRealizer { //! Constructor /*! Constructs a new object, given a prefix and the image set of the vector realizer, a - * vector of mean values, \c lawExpVector, and a set of two matrices and one vector - * resulting from the Single Value Decomposition of the covariance matrix, \c matU, - * \c vecSsqrt and \c matVt. */ + * vector of mean values, \c lawExpVector, and a set of two matrices and one vector + * resulting from the Single Value Decomposition of the covariance matrix, \c matU, + * \c vecSsqrt and \c matVt. */ GaussianVectorRealizer(const char* prefix, const VectorSet& unifiedImageSet, const V& lawExpVector, // vector of mean values @@ -73,35 +73,35 @@ class GaussianVectorRealizer : public BaseVectorRealizer { //! @name Realization-related methods //@{ - //! Access to the vector of mean values and private attribute: m_unifiedLawExpVector. + //! Access to the vector of mean values and private attribute: m_unifiedLawExpVector. const V& unifiedLawExpVector () const; - - //! Access to the vector of variance values and private attribute: m_unifiedLawVarVector. + + //! Access to the vector of variance values and private attribute: m_unifiedLawVarVector. const V& unifiedLawVarVector () const; - + //! Draws a realization. - /*! This function draws a realization of a Gaussian distribution of mean \c m_unifiedLawExpVector + /*! This function draws a realization of a Gaussian distribution of mean \c m_unifiedLawExpVector * and variance \c m_unifiedLawVarVector and saves it in \c nextValues.*/ void realization (V& nextValues) const; - - //! Updates the mean with the new value \c newLawExpVector. + + //! Updates the mean with the new value \c newLawExpVector. void updateLawExpVector (const V& newLawExpVector); - + //! Updates the lower triangular matrix from Cholesky decomposition of the covariance matrix to the new value \c newLowerCholLawCovMatrix. - /*! The lower triangular matrix results resulting from a Cholesky decomposition of the + /*! The lower triangular matrix results resulting from a Cholesky decomposition of the * covariance matrix. This routine deletes old expected values: m_lowerCholLawCovMatrix; * m_matU, m_vecSsqrt, m_matVt.*/ void updateLowerCholLawCovMatrix(const M& newLowerCholLawCovMatrix); - + //! Updates the SVD matrices from SVD decomposition of the covariance matrix to the new values: \c matU, \c vecSsqrt, and \c matVt. - /*! The lower triangular matrix results resulting from a Cholesky decomposition of the + /*! The lower triangular matrix results resulting from a Cholesky decomposition of the * covariance matrix. This routine deletes old expected values: m_lowerCholLawCovMatrix; * m_matU, m_vecSsqrt, m_matVt. */ void updateLowerCholLawCovMatrix(const M& matU, const V& vecSsqrt, const M& matVt); //@} - + private: V* m_unifiedLawExpVector; V* m_unifiedLawVarVector; diff --git a/src/stats/inc/GenericJointPdf.h b/src/stats/inc/GenericJointPdf.h index 649bbb812..e1dc3622c 100644 --- a/src/stats/inc/GenericJointPdf.h +++ b/src/stats/inc/GenericJointPdf.h @@ -48,12 +48,12 @@ namespace QUESO { template class GenericJointPdf : public BaseJointPdf { public: - + //! @name Constructor/Destructor methods //@{ - //! Default constructor. + //! Default constructor. /*! Instantiates an object of this class given a prefix and a scalar function. - * The domain of the scalar function is assigned to the protected attribute m_domainSet, + * The domain of the scalar function is assigned to the protected attribute m_domainSet, * and the scalar function is also itself copied to the protected attribute m_scalarFunction.*/ GenericJointPdf(const char* prefix, const BaseScalarFunction& scalarFunction); diff --git a/src/stats/inc/GenericMatrixCovarianceFunction.h b/src/stats/inc/GenericMatrixCovarianceFunction.h index 33771c723..d489c415b 100644 --- a/src/stats/inc/GenericMatrixCovarianceFunction.h +++ b/src/stats/inc/GenericMatrixCovarianceFunction.h @@ -35,17 +35,17 @@ namespace QUESO { //***************************************************** // Generic class //***************************************************** -/*! +/*! * \class GenericMatrixCovarianceFunction * \brief A class for generic covariance matrices. - * + * * This class implements a generic covariance matrices by calling a routine (via pointer).*/ template class GenericMatrixCovarianceFunction : public BaseMatrixCovarianceFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Instantiates an object of the class given a prefix, the domain set, the pointer to the routine. */ GenericMatrixCovarianceFunction(const char* prefix, @@ -56,7 +56,7 @@ class GenericMatrixCovarianceFunction : public BaseMatrixCovarianceFunction class GenericScalarCovarianceFunction : public BaseScalarCovarianceFunction { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. /*! Instantiates an object of the class given a prefix, the domain set, the pointer to the routine. */ GenericScalarCovarianceFunction(const char* prefix, const VectorSet& domainSet, double (*covRoutinePtr)(const V& positionVector1, const V& positionVector2, const void* routineDataPtr), const void* routinesDataPtr); - + //! Virtual destructor virtual ~GenericScalarCovarianceFunction(); //@} diff --git a/src/stats/inc/GenericVectorCdf.h b/src/stats/inc/GenericVectorCdf.h index f4c8b5750..bfb8d0347 100644 --- a/src/stats/inc/GenericVectorCdf.h +++ b/src/stats/inc/GenericVectorCdf.h @@ -37,19 +37,19 @@ namespace QUESO { //***************************************************** // Generic cumulative distribution function class //***************************************************** -/*! +/*! * \class GenericVectorCdf * \brief A class for handling generic vector CDFs. * * This class \b will implement a generic vector cumulative distribution function (CDF).*/ - + template class GenericVectorCdf : public BaseVectorCdf { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Constructor. - /*! Instantiates an object of the class given a prefix, the support of the related-PDF, and + /*! Instantiates an object of the class given a prefix, the support of the related-PDF, and * a routine that calculates data (like a math function). */ GenericVectorCdf(const char* prefix, const VectorSet& pdfSupport, @@ -61,17 +61,17 @@ class GenericVectorCdf : public BaseVectorCdf { //! @name Mathematical method //@{ - //! TODO: Returns the values of the vector CDF at each element of \c paramValues, by calling \c m_routinePtr. + //! TODO: Returns the values of the vector CDF at each element of \c paramValues, by calling \c m_routinePtr. void values(const V& paramValues, V& cdfVec) const; //@} - + //! @name I/O method - //@{ - //! TODO: Prints the vector CDF. + //@{ + //! TODO: Prints the vector CDF. /*! \todo: implement me!*/ void print (std::ostream& os) const; //@} - + protected: double (*m_routinePtr)(const V& paramValues, const void* routineDataPtr, V& cdfVec); const void* m_routineDataPtr; diff --git a/src/stats/inc/GenericVectorMdf.h b/src/stats/inc/GenericVectorMdf.h index 7314b31e3..ae6bd5704 100644 --- a/src/stats/inc/GenericVectorMdf.h +++ b/src/stats/inc/GenericVectorMdf.h @@ -43,10 +43,10 @@ template class GenericVectorMdf : public BaseVectorMdf { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Constructor. - /*! Instantiates an object of the class given a prefix, the domain set, and a routine - * (acting as a math function). */ + /*! Instantiates an object of the class given a prefix, the domain set, and a routine + * (acting as a math function). */ GenericVectorMdf(const char* prefix, const VectorSet& domainSet, double (*routinePtr)(const V& paramValues, const void* routineDataPtr, V& mdfVec), @@ -60,10 +60,10 @@ class GenericVectorMdf : public BaseVectorMdf { //! Finds the values of the vector MDF at each element of \c paramValues, by calling \c m_routinePtr, and saves it at \c mdfValues. void values(const V& paramValues, V& mdfVec) const; //@} - + //! @name I/O method - //@{ - //! TODO: Prints the vector MDF. + //@{ + //! TODO: Prints the vector MDF. /*! \todo: implement me!*/ void print (std::ostream& os) const; //@} diff --git a/src/stats/inc/GenericVectorRV.h b/src/stats/inc/GenericVectorRV.h index 12844289a..9db15a603 100644 --- a/src/stats/inc/GenericVectorRV.h +++ b/src/stats/inc/GenericVectorRV.h @@ -44,9 +44,9 @@ namespace QUESO { * \brief A templated class for handling generic vector RVs. * * This class allows the user to compute the value of the PDF of a generic random variable (RV) - * and to generate realizations (samples) from such PDF. This is the class used by QUESO to + * and to generate realizations (samples) from such PDF. This is the class used by QUESO to * store the solution of an statistical inverse problem. */ - + template class GenericVectorRV : public BaseVectorRV { public: @@ -56,7 +56,7 @@ class GenericVectorRV : public BaseVectorRV { /*! Constructs a new instance, given a prefix and the image set of the vector RV.*/ GenericVectorRV(const char* prefix, const VectorSet & imageSet); - + //! Constructor /*! Constructs a new instance, given all the attributes that characterize the vector RV: prefix, image set, pdf, etc.*/ GenericVectorRV(const char* prefix, @@ -69,25 +69,25 @@ class GenericVectorRV : public BaseVectorRV { //! Virtual destructor virtual ~GenericVectorRV(); //@} - + //! @name Random variable-handling methods //@{ - //! Sets the PDF of \c this vector RV to \c pdf. + //! Sets the PDF of \c this vector RV to \c pdf. void setPdf (BaseJointPdf & pdf ); - - //! Sets the realizer of \c this vector RV to \c realizer. + + //! Sets the realizer of \c this vector RV to \c realizer. void setRealizer (BaseVectorRealizer& realizer ); - + //! Sets the CDF of the sub-sequence of \c this vector RV to \c subCdf. void setSubCdf (BaseVectorCdf & subCdf ); - + //! Sets the CDF of the unified sequence of \c this vector RV to \c unifiedCdf. void setUnifiedCdf(BaseVectorCdf & unifiedCdf); - + //! Sets the MDF of \c this vector RV to \c Mdf. void setMdf (BaseVectorMdf & mdf ); - //@} - + //@} + //! @name I/O methods //@{ //! TODO: Prints the vector RV. diff --git a/src/stats/inc/GenericVectorRealizer.h b/src/stats/inc/GenericVectorRealizer.h index 5f3489025..fbf109d2b 100644 --- a/src/stats/inc/GenericVectorRealizer.h +++ b/src/stats/inc/GenericVectorRealizer.h @@ -35,13 +35,13 @@ namespace QUESO { //***************************************************** // Generic class [R-01] //***************************************************** -/*! +/*! * \class GenericVectorRealizer * \brief A class for handling sampling from generic probability density distributions. * - * A realizer is an object that, simply put, contains a realization() operation - * that returns a sample of a vector RV, or, particularly, a generic probability - * density distribution. This is the class that handles generic sampling, used, + * A realizer is an object that, simply put, contains a realization() operation + * that returns a sample of a vector RV, or, particularly, a generic probability + * density distribution. This is the class that handles generic sampling, used, * for example, to sample, posterior PDFs (the solution of a Bayesian problem).*/ template @@ -51,8 +51,8 @@ class GenericVectorRealizer : public BaseVectorRealizer { //! @name Constructor/Destructor methods //@{ //! Default constructor - /*! Constructs a new object, given a prefix and the image set of the vector realizer, - * the sub period for the realizations and a pointer to a generic routine. */ + /*! Constructs a new object, given a prefix and the image set of the vector realizer, + * the sub period for the realizations and a pointer to a generic routine. */ GenericVectorRealizer(const char* prefix, const VectorSet& unifiedImageSet, unsigned int subPeriod, @@ -61,7 +61,7 @@ class GenericVectorRealizer : public BaseVectorRealizer { //! Destructor ~GenericVectorRealizer(); //@} - + //! @name Realization-related methods //! Draws a realization. /*! This function draws a realization of \c this considering the generic routine \c m_routinePtr diff --git a/src/stats/inc/HessianCovMatricesTKGroup.h b/src/stats/inc/HessianCovMatricesTKGroup.h index 2a7d46463..22bdb9d62 100644 --- a/src/stats/inc/HessianCovMatricesTKGroup.h +++ b/src/stats/inc/HessianCovMatricesTKGroup.h @@ -41,39 +41,39 @@ template class HessianCovMatricesTKGroup : public BaseTKGroup { public: //! @name Constructor/Destructor methods - //@{ + //@{ //! Default constructor. HessianCovMatricesTKGroup(const char* prefix, const VectorSpace& vectorSpace, const std::vector& scales, const ScalarFunctionSynchronizer& targetPdfSynchronizer); - + //! Destructor. ~HessianCovMatricesTKGroup(); //@} - + //! @name Statistical/Mathematical methods //@{ //! Whether or not the matrix is symmetric. Always 'false'. /*! \todo: It only returns 'false', thus a test for its symmetricity must be included.*/ bool symmetric () const; - + //! Gaussian increment property to construct a transition kernel. const GaussianVectorRV& rv (unsigned int stageId ) const; - + //! Gaussian increment property to construct a transition kernel. const GaussianVectorRV& rv (const std::vector& stageIds); //@} - + //! @name Misc methods //@{ //! Sets the pre-computing positions \c m_preComputingPositions[stageId] with a new vector of size \c position. bool setPreComputingPosition (const V& position, unsigned int stageId ); - + //! Clears the pre-computing positions \c m_preComputingPositions[stageId] void clearPreComputingPositions(); //@} - + //! @name I/O methods //@{ //! TODO: Prints the transition kernel. diff --git a/src/stats/inc/InfoTheory.h b/src/stats/inc/InfoTheory.h index cfc752c10..9d1638edf 100644 --- a/src/stats/inc/InfoTheory.h +++ b/src/stats/inc/InfoTheory.h @@ -39,10 +39,10 @@ namespace QUESO { -void distANN_XY( const ANNpointArray dataX, const ANNpointArray dataY, - double* distsXY, - unsigned int dimX, unsigned int dimY, - unsigned int xN, unsigned int yN, +void distANN_XY( const ANNpointArray dataX, const ANNpointArray dataY, + double* distsXY, + unsigned int dimX, unsigned int dimY, + unsigned int xN, unsigned int yN, unsigned int k, double eps ); void normalizeANN_XY( ANNpointArray dataXY, unsigned int dimXY, @@ -50,7 +50,7 @@ void normalizeANN_XY( ANNpointArray dataXY, unsigned int dimXY, ANNpointArray dataY, unsigned int dimY, unsigned int N ); -void whiteningANN_X_Y( ANNpointArray dataX1, ANNpointArray dataX2, +void whiteningANN_X_Y( ANNpointArray dataX1, ANNpointArray dataX2, unsigned int dimX, unsigned int N1, unsigned int N2 ); double computeMI_ANN( ANNpointArray dataXY, @@ -62,7 +62,7 @@ double computeMI_ANN( ANNpointArray dataXY, // (Mutual Information) //***************************************************** template
    \f$ n \f$\f$ x_i \f$\f$ w_i \f$