Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector constants #632

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions developer_tools/XSDSchemas/Optimizers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<xsd:element name="shape" type="xsd:string" minOccurs="0"/>
</xsd:all>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="optSubspaceType">
Expand Down Expand Up @@ -65,6 +66,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="objectVar" type="xsd:string" minOccurs="1" maxOccurs="1"/>
Expand Down
16 changes: 15 additions & 1 deletion developer_tools/XSDSchemas/Samplers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
<xsd:element name="distribution" type="extendedVariableDistributionType" minOccurs="1"/>
<xsd:element name="function" type="xsd:string" minOccurs="1"/>
</xsd:choice>
<xsd:element name="shape" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="extendedVariableType">
Expand All @@ -117,6 +117,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Restart" type="AssemblerObjectType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -139,6 +140,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Restart" type="AssemblerObjectType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -155,6 +157,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Distribution" type="extendedVariableType" minOccurs="0" maxOccurs="unbounded"/>
Expand Down Expand Up @@ -187,6 +190,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<!--xsd:element name="Distribution" type="variableType" minOccurs="0" maxOccurs="unbounded"/-->
Expand Down Expand Up @@ -232,6 +236,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="variablesTransformation" type="variablesTransformationType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -255,6 +260,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
Expand All @@ -268,6 +274,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="MonteCarlo" type="MonteCarloSampler" minOccurs="0" maxOccurs="1"/>
Expand Down Expand Up @@ -335,6 +342,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
Expand Down Expand Up @@ -367,6 +375,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="variablesTransformation" type="variablesTransformationType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -391,6 +400,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="variablesTransformation" type="variablesTransformationType" minOccurs="0" maxOccurs="unbounded"/>
Expand Down Expand Up @@ -430,6 +440,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Distribution" type="extendedVariableType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -448,6 +459,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Distribution" type="extendedVariableType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -461,6 +473,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Distribution" type="extendedVariableType" minOccurs="0" maxOccurs="unbounded"/>
Expand Down Expand Up @@ -488,6 +501,7 @@
<xsd:element name="constant" minOccurs="0" maxOccurs='unbounded'>
<xsd:complexType mixed="true">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="shape" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="Distribution" type="extendedVariableType" minOccurs="0" maxOccurs="unbounded"/>
Expand Down
59 changes: 31 additions & 28 deletions doc/user_manual/sampler.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ \section{Samplers}
\nb As with other objects, this identifier can be used to reference this
specific entity from other input blocks in the XML.
}
\newcommand{\shapeVariableDescription}
{
\xmlAttr{shape},
\xmlDesc{comma-separated integers, optional field},
determines the number of samples and shape of samples
to be taken. For example, \xmlAttr{shape}=``2,3'' will provide a 2 by 3
matrix of values, while \xmlAttr{shape}=``10'' will produce a vector of 10 values.
Omitting this optional attribute will result in a single scalar value instead.
Each of the values in the matrix or vector will be the same as the single sampled value.
\nb A model interface must be prepared to handle non-scalar inputs to use this option.
}
\newcommand{\shapeConstantDescription}
{
\xmlAttr{shape},
\xmlDesc{comma-separated integers, optional field},
determines the shape of samples of the constant value.
For example, \xmlAttr{shape}=``2,3'' will shape the values into a 2 by 3
matrix, while \xmlAttr{shape}=``10'' will shape into a vector of 10 values.
Unlike the \xmlNode{variable}, the constant requires each value be entered; the number
of required values is equal to the product of the \xmlAttr{shape}.
\nb A model interface must be prepared to handle non-scalar inputs to use this option.
}

\renewcommand{\specBlock}[2]
{
The specifications of this sampler must be defined within #1 \xmlNode{#2} XML
Expand Down Expand Up @@ -98,10 +121,11 @@ \section{Samplers}
\newcommand{\variableDescription}
{
\xmlNode{variable}, \xmlDesc{XML node,
required parameter} will specify one attribute:
required parameter} can specify the following attribute:
\begin{itemize}
\item \xmlAttr{name}, \xmlDesc{required string attribute}, user-defined name
of this variable.
\item \shapeVariableDescription
\end{itemize}
}

Expand All @@ -112,7 +136,12 @@ \section{Samplers}
kept constant.
For doing this, as many \xmlNode{constant} nodes as needed can be
input, where the body of the node contains the constant value that is
going to be injected as an additional variable
going to be injected as an additional variable. The constant has the following attributes:
\begin{itemize}
\item \xmlAttr{name}, \xmlDesc{required string attribute}, user-defined name
of this constant.
\item \shapeConstantDescription
\end{itemize}
}

\newcommand{\distributionDescription}
Expand All @@ -133,16 +162,6 @@ \section{Samplers}
\nb{Alternatively, this node must be ommitted
if the \xmlNode{distribution} node is supplied.}
}
\newcommand{\shapeDescription}
{
\xmlNode{shape}, \xmlDesc{comma-separated integers,
optional field}, determines the number of samples and shape of samples
to be taken. For example, \xmlNode{shape}2,3\xmlNode{/shape} will provide
a 2 x 3 matrix of values. In general, samplers will simply replicate
the single sampled value into each point of the matrix. Omitting this optional
node will result in a single scalar value instead. \nb A model interface
must be prepared to handle non-scalar inputs to use this option.
}



Expand Down Expand Up @@ -577,7 +596,6 @@ \subsubsection{Monte Carlo}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -667,7 +685,6 @@ \subsubsection{Grid}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -764,7 +781,6 @@ \subsubsection{Sparse Grid Collocation}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -904,7 +920,6 @@ \subsubsection{Sobol}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -981,7 +996,6 @@ \subsubsection{Stratified}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -1196,7 +1210,6 @@ \subsubsection{Response Surface Design}
\item \functionDescription
\item \gridDescriptionOnlyCustom
\nb{Only the construction ``custom'' is available. In the \xmlNode{grid} body only the lower and upper bounds can be inputted (2 numbers only).}
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\item \xmlNode{ResponseSurfaceDesignSettings}, \xmlDesc{required},
Expand Down Expand Up @@ -1384,7 +1397,6 @@ \subsubsection{Factorial Design}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -1799,7 +1811,6 @@ \subsubsection{Dynamic Event Tree}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -1910,7 +1921,6 @@ \subsubsection{Hybrid Dynamic Event Tree}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -1948,7 +1958,6 @@ \subsubsection{Hybrid Dynamic Event Tree}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -2095,7 +2104,6 @@ \subsubsection{Limit Surface Search}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\end{itemize}

Expand Down Expand Up @@ -2332,7 +2340,6 @@ \subsubsection{Adaptive Dynamic Event Tree}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -2487,7 +2494,6 @@ \subsubsection{Adaptive Hybrid Dynamic Event Tree}
\item \distributionDescription
\item \functionDescription
\item \gridDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -2560,7 +2566,6 @@ \subsubsection{Adaptive Hybrid Dynamic Event Tree}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -2658,7 +2663,6 @@ \subsubsection{Adaptive Sparse Grid}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down Expand Up @@ -2839,7 +2843,6 @@ \subsubsection{Adaptive Sobol Decomposition}
\begin{itemize}
\item \distributionDescription
\item \functionDescription
\item \shapeDescription
\end{itemize}
\item \constantVariablesDescription
\end{itemize}
Expand Down
Loading