<?xml version="1.0" encoding="UTF-8"?>
<Operator xmlns="http://www.esterel-technologies.com/ns/scade/6" xmlns:ed="http://www.esterel-technologies.com/ns/scade/pragmas/editor/5" xmlns:kcg="http://www.esterel-technologies.com/ns/scade/pragmas/codegen/3" kind="function" visibility="private" name="map_compute_distances">
	<inputs>
		<Variable name="intput_param">
			<type>
				<Table>
					<type>
						<NamedType>
							<type>
								<TypeRef name="float32"/>
							</type>
						</NamedType>
					</type>
					<size>
						<ConstValue value="4"/>
					</size>
				</Table>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10c0/4B98/1E78/58f5f29c2458"/>
				<kcg:Pragma>
					doc &quot;Comment_1&quot; {Comment = &quot;&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Unit_2&quot; {Unit = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Range_3&quot; {Range = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Resolution_4&quot; {Resolution = &quot;TBD&quot;}
				</kcg:Pragma>
			</pragmas>
		</Variable>
		<Variable name="resp_vector">
			<type>
				<Table>
					<type>
						<NamedType>
							<type>
								<TypeRef name="float32"/>
							</type>
						</NamedType>
					</type>
					<size>
						<ConstValue value="4"/>
					</size>
				</Table>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10d2/4B98/1E78/58f5f2b93129"/>
				<kcg:Pragma>
					doc &quot;Comment_1&quot; {Comment = &quot;&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Unit_2&quot; {Unit = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Range_3&quot; {Range = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Resolution_4&quot; {Resolution = &quot;TBD&quot;}
				</kcg:Pragma>
			</pragmas>
		</Variable>
	</inputs>
	<outputs>
		<Variable name="distance">
			<type>
				<NamedType>
					<type>
						<TypeRef name="float32"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10d3/4B98/1E78/58f5f2c46469"/>
				<kcg:Pragma>
					doc &quot;Comment_1&quot; {Comment = &quot;&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Unit_2&quot; {Unit = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Range_3&quot; {Range = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Resolution_4&quot; {Resolution = &quot;TBD&quot;}
				</kcg:Pragma>
			</pragmas>
		</Variable>
		<Variable name="is_distance_null">
			<type>
				<NamedType>
					<type>
						<TypeRef name="bool"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10dd/4B98/1E78/58f5f2e250cd"/>
				<kcg:Pragma>
					doc &quot;Comment_1&quot; {Comment = &quot;&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Unit_2&quot; {Unit = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Range_3&quot; {Range = &quot;TBD&quot;}
				</kcg:Pragma>
				<kcg:Pragma>
					doc &quot;Resolution_4&quot; {Resolution = &quot;TBD&quot;}
				</kcg:Pragma>
			</pragmas>
		</Variable>
	</outputs>
	<locals>
		<Variable name="_L1">
			<type>
				<Table>
					<type>
						<NamedType>
							<type>
								<TypeRef name="float32"/>
							</type>
						</NamedType>
					</type>
					<size>
						<ConstValue value="4"/>
					</size>
				</Table>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10e7/4B98/1E78/58f5f3343e26"/>
			</pragmas>
		</Variable>
		<Variable name="_L2">
			<type>
				<Table>
					<type>
						<NamedType>
							<type>
								<TypeRef name="float32"/>
							</type>
						</NamedType>
					</type>
					<size>
						<ConstValue value="4"/>
					</size>
				</Table>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10e9/4B98/1E78/58f5f3346ced"/>
			</pragmas>
		</Variable>
		<Variable name="_L3">
			<type>
				<Table>
					<type>
						<NamedType>
							<type>
								<TypeRef name="float32"/>
							</type>
						</NamedType>
					</type>
					<size>
						<ConstValue value="4"/>
					</size>
				</Table>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/10f7/4B98/1E78/58f5f3387e95"/>
			</pragmas>
		</Variable>
		<Variable name="_L5">
			<type>
				<NamedType>
					<type>
						<TypeRef name="float32"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/112a/4B98/1E78/58f5f37dea0"/>
			</pragmas>
		</Variable>
		<Variable name="_L6">
			<type>
				<NamedType>
					<type>
						<TypeRef name="float32"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/1139/4B98/1E78/58f5f38c1e99"/>
			</pragmas>
		</Variable>
		<Variable name="_L9">
			<type>
				<NamedType>
					<type>
						<TypeRef name="bool"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/30aa/4B98/1E78/58f5f6573c4a"/>
			</pragmas>
		</Variable>
		<Variable name="_L8">
			<type>
				<NamedType>
					<type>
						<TypeRef name="float32"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/30a9/4B98/1E78/58f5f6574a49"/>
			</pragmas>
		</Variable>
		<Variable name="_L10">
			<type>
				<NamedType>
					<type>
						<TypeRef name="float32"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/2e48/1A70/1E14/58f638f91402"/>
			</pragmas>
		</Variable>
		<Variable name="_L11">
			<type>
				<NamedType>
					<type>
						<TypeRef name="float32"/>
					</type>
				</NamedType>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/1a0a/654E/1838/58f70be97f20"/>
			</pragmas>
		</Variable>
		<Variable name="_L12">
			<type>
				<Table>
					<type>
						<NamedType>
							<type>
								<TypeRef name="float32"/>
							</type>
						</NamedType>
					</type>
					<size>
						<ConstValue value="4"/>
					</size>
				</Table>
			</type>
			<pragmas>
				<ed:Variable oid="!ed/1a10/654E/1838/58f70bee6c9b"/>
			</pragmas>
		</Variable>
	</locals>
	<data>
		<!-- _L1 = intput_param; -->
		<Equation>
			<lefts>
				<VariableRef name="_L1"/>
			</lefts>
			<right>
				<IdExpression>
					<path>
						<ConstVarRef name="intput_param"/>
					</path>
				</IdExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/10e6/4B98/1E78/58f5f3341e65"/>
			</pragmas>
		</Equation>
		<!-- _L2 = resp_vector; -->
		<Equation>
			<lefts>
				<VariableRef name="_L2"/>
			</lefts>
			<right>
				<IdExpression>
					<path>
						<ConstVarRef name="resp_vector"/>
					</path>
				</IdExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/10e8/4B98/1E78/58f5f3342b57"/>
			</pragmas>
		</Equation>
		<!-- _L3 = (map $-$ <<4>>)(_L1, _L2); -->
		<Equation>
			<lefts>
				<VariableRef name="_L3"/>
			</lefts>
			<right>
				<!-- (map $-$ <<4>>)(_L1, _L2) -->
				<CallExpression>
					<operator>
						<IteratorOp name="2" iterator="map">
							<operator>
								<OpCall name="1">
									<operator>
										<OperatorRef name="$-$"/>
									</operator>
								</OpCall>
							</operator>
							<size>
								<ConstValue value="4"/>
							</size>
						</IteratorOp>
					</operator>
					<callParameters>
						<IdExpression>
							<path>
								<ConstVarRef name="_L1"/>
							</path>
						</IdExpression>
						<IdExpression>
							<path>
								<ConstVarRef name="_L2"/>
							</path>
						</IdExpression>
					</callParameters>
				</CallExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/10f6/4B98/1E78/58f5f338e41"/>
			</pragmas>
		</Equation>
		<!-- _L5 = (fold $+$ <<4>>)(_L6, _L12); -->
		<Equation>
			<lefts>
				<VariableRef name="_L5"/>
			</lefts>
			<right>
				<!-- (fold $+$ <<4>>)(_L6, _L12) -->
				<CallExpression>
					<operator>
						<IteratorOp name="4" iterator="fold">
							<operator>
								<OpCall name="1">
									<operator>
										<OperatorRef name="$+$"/>
									</operator>
								</OpCall>
							</operator>
							<size>
								<ConstValue value="4"/>
							</size>
						</IteratorOp>
					</operator>
					<callParameters>
						<IdExpression>
							<path>
								<ConstVarRef name="_L6"/>
							</path>
						</IdExpression>
						<IdExpression>
							<path>
								<ConstVarRef name="_L12"/>
							</path>
						</IdExpression>
					</callParameters>
				</CallExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/1129/4B98/1E78/58f5f37d6435"/>
			</pragmas>
		</Equation>
		<!-- _L6 = 0.0; -->
		<Equation>
			<lefts>
				<VariableRef name="_L6"/>
			</lefts>
			<right>
				<ConstValue value="0.0"/>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/1138/4B98/1E78/58f5f38c383d"/>
			</pragmas>
		</Equation>
		<!-- distance = _L11; -->
		<Equation>
			<lefts>
				<VariableRef name="distance"/>
			</lefts>
			<right>
				<IdExpression>
					<path>
						<ConstVarRef name="_L11"/>
					</path>
				</IdExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/30a3/4B98/1E78/58f5f63d5542"/>
			</pragmas>
		</Equation>
		<!-- _L8, _L9 = utl_mm::verify_epsilon(_L11, _L10); -->
		<Equation>
			<lefts>
				<VariableRef name="_L8"/>
				<VariableRef name="_L9"/>
			</lefts>
			<right>
				<!-- utl_mm::verify_epsilon(_L11, _L10) -->
				<CallExpression>
					<operator>
						<OpCall name="1">
							<operator>
								<OperatorRef name="utl_mm::verify_epsilon"/>
							</operator>
						</OpCall>
					</operator>
					<callParameters>
						<IdExpression>
							<path>
								<ConstVarRef name="_L11"/>
							</path>
						</IdExpression>
						<IdExpression>
							<path>
								<ConstVarRef name="_L10"/>
							</path>
						</IdExpression>
					</callParameters>
				</CallExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/30a8/4B98/1E78/58f5f657383a"/>
			</pragmas>
		</Equation>
		<!-- _L10 = epsilon_Cst; -->
		<Equation>
			<lefts>
				<VariableRef name="_L10"/>
			</lefts>
			<right>
				<IdExpression>
					<path>
						<ConstVarRef name="epsilon_Cst"/>
					</path>
				</IdExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/2e47/1A70/1E14/58f638f94f66"/>
			</pragmas>
		</Equation>
		<!-- _ = _L8; -->
		<Equation>
			<lefts>
				<VariableRef name="_"/>
			</lefts>
			<right>
				<IdExpression>
					<path>
						<ConstVarRef name="_L8"/>
					</path>
				</IdExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/2e4f/1A70/1E14/58f63923757"/>
			</pragmas>
		</Equation>
		<!-- is_distance_null = _L9; -->
		<Equation>
			<lefts>
				<VariableRef name="is_distance_null"/>
			</lefts>
			<right>
				<IdExpression>
					<path>
						<ConstVarRef name="_L9"/>
					</path>
				</IdExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/2e55/1A70/1E14/58f639337b5a"/>
			</pragmas>
		</Equation>
		<!-- _L11 = utl_mm::SqrtR32(_L5); -->
		<Equation>
			<lefts>
				<VariableRef name="_L11"/>
			</lefts>
			<right>
				<!-- utl_mm::SqrtR32(_L5) -->
				<CallExpression>
					<operator>
						<OpCall name="1">
							<operator>
								<OperatorRef name="utl_mm::SqrtR32"/>
							</operator>
						</OpCall>
					</operator>
					<callParameters>
						<IdExpression>
							<path>
								<ConstVarRef name="_L5"/>
							</path>
						</IdExpression>
					</callParameters>
				</CallExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/1a09/654E/1838/58f70be9584d"/>
			</pragmas>
		</Equation>
		<!-- _L12 = (map utl_mm::Square <<4>>)(_L3); -->
		<Equation>
			<lefts>
				<VariableRef name="_L12"/>
			</lefts>
			<right>
				<!-- (map utl_mm::Square <<4>>)(_L3) -->
				<CallExpression>
					<operator>
						<IteratorOp name="6" iterator="map">
							<operator>
								<OpCall name="1">
									<operator>
										<OperatorRef name="utl_mm::Square"/>
									</operator>
								</OpCall>
							</operator>
							<size>
								<ConstValue value="4"/>
							</size>
						</IteratorOp>
					</operator>
					<callParameters>
						<IdExpression>
							<path>
								<ConstVarRef name="_L3"/>
							</path>
						</IdExpression>
					</callParameters>
				</CallExpression>
			</right>
			<pragmas>
				<ed:Equation oid="!ed/1a0f/654E/1838/58f70bee1ab7"/>
			</pragmas>
		</Equation>
	</data>
	<pragmas>
		<ed:Operator oid="!ed/10be/4B98/1E78/58f5f28f745d" xmlns="http://www.esterel-technologies.com/ns/scade/pragmas/editor/5">
			<comment>computes the distance from the input parameters (4 parameters vector) to the vector in the response surface</comment>
			<comment>checks if distance is zero (inferior to epsilon)</comment>
			<diagrams>
				<NetDiagram name="map_compute_distances_1" landscape="true" format="A4 (210 297)" oid="!ed/10bf/4B98/1E78/58f5f28fc06">
					<presentationElements>
						<EquationGE presentable="!ed/10e6/4B98/1E78/58f5f3341e65">
							<position>
								<Point x="2053" y="5313"/>
							</position>
							<size>
								<Size width="254" height="508"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/10e8/4B98/1E78/58f5f3342b57">
							<position>
								<Point x="2053" y="6011"/>
							</position>
							<size>
								<Size width="254" height="508"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/10f6/4B98/1E78/58f5f338e41">
							<position>
								<Point x="2638" y="4882"/>
							</position>
							<size>
								<Size width="2238" height="2069"/>
							</size>
						</EquationGE>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/10e6/4B98/1E78/58f5f3341e65" dstEquation="!ed/10f6/4B98/1E78/58f5f338e41">
							<positions>
								<Point x="2307" y="5567"/>
								<Point x="2477" y="5567"/>
								<Point x="2477" y="5567"/>
								<Point x="2646" y="5567"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="2" srcEquation="!ed/10e8/4B98/1E78/58f5f3342b57" dstEquation="!ed/10f6/4B98/1E78/58f5f338e41">
							<positions>
								<Point x="2307" y="6265"/>
								<Point x="2477" y="6265"/>
								<Point x="2477" y="6265"/>
								<Point x="2646" y="6265"/>
							</positions>
						</Edge>
						<EquationGE presentable="!ed/1129/4B98/1E78/58f5f37d6435">
							<position>
								<Point x="9271" y="4784"/>
							</position>
							<size>
								<Size width="2259" height="2069"/>
							</size>
						</EquationGE>
						<EquationGE kind="OBJ_LIT" presentable="!ed/1138/4B98/1E78/58f5f38c383d">
							<position>
								<Point x="8488" y="4276"/>
							</position>
							<size>
								<Size width="169" height="318"/>
							</size>
						</EquationGE>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/1138/4B98/1E78/58f5f38c383d" dstEquation="!ed/1129/4B98/1E78/58f5f37d6435">
							<positions>
								<Point x="8657" y="4445"/>
								<Point x="8805" y="4445"/>
								<Point x="8805" y="5482"/>
								<Point x="9271" y="5482"/>
							</positions>
						</Edge>
						<EquationGE presentable="!ed/30a3/4B98/1E78/58f5f63d5542">
							<position>
								<Point x="16023" y="5228"/>
							</position>
							<size>
								<Size width="339" height="508"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/30a8/4B98/1E78/58f5f657383a">
							<position>
								<Point x="16002" y="6414"/>
							</position>
							<size>
								<Size width="3572" height="2069"/>
							</size>
						</EquationGE>
						<EquationGE kind="OBJ_LIT" presentable="!ed/2e47/1A70/1E14/58f638f94f66">
							<position>
								<Point x="17230" y="8636"/>
							</position>
							<size>
								<Size width="170" height="317"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/2e4f/1A70/1E14/58f63923757">
							<position>
								<Point x="20045" y="6837"/>
							</position>
							<size>
								<Size width="508" height="508"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/2e55/1A70/1E14/58f639337b5a">
							<position>
								<Point x="20045" y="7535"/>
							</position>
							<size>
								<Size width="339" height="508"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/1a09/654E/1838/58f70be9584d">
							<position>
								<Point x="12171" y="4784"/>
							</position>
							<size>
								<Size width="3191" height="2069"/>
							</size>
						</EquationGE>
						<EquationGE presentable="!ed/1a0f/654E/1838/58f70bee1ab7">
							<position>
								<Point x="5525" y="4890"/>
							</position>
							<size>
								<Size width="3106" height="2069"/>
							</size>
						</EquationGE>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/10f6/4B98/1E78/58f5f338e41" dstEquation="!ed/1a0f/654E/1838/58f70bee1ab7">
							<positions>
								<Point x="4868" y="5927"/>
								<Point x="5482" y="5927"/>
								<Point x="5482" y="5927"/>
								<Point x="5525" y="5927"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="2" srcEquation="!ed/1a0f/654E/1838/58f70bee1ab7" dstEquation="!ed/1129/4B98/1E78/58f5f37d6435">
							<positions>
								<Point x="8636" y="5927"/>
								<Point x="8932" y="5927"/>
								<Point x="8932" y="6160"/>
								<Point x="9271" y="6160"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/1a09/654E/1838/58f70be9584d" dstEquation="!ed/30a3/4B98/1E78/58f5f63d5542">
							<positions>
								<Point x="15367" y="5821"/>
								<Point x="15706" y="5821"/>
								<Point x="15706" y="5482"/>
								<Point x="16066" y="5482"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/1129/4B98/1E78/58f5f37d6435" dstEquation="!ed/1a09/654E/1838/58f70be9584d">
							<positions>
								<Point x="11536" y="5821"/>
								<Point x="11599" y="5821"/>
								<Point x="11599" y="5821"/>
								<Point x="12171" y="5821"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="2" rightExprIndex="1" srcEquation="!ed/30a8/4B98/1E78/58f5f657383a" dstEquation="!ed/2e55/1A70/1E14/58f639337b5a">
							<positions>
								<Point x="19579" y="7789"/>
								<Point x="19812" y="7789"/>
								<Point x="19812" y="7789"/>
								<Point x="20087" y="7789"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/30a8/4B98/1E78/58f5f657383a" dstEquation="!ed/2e4f/1A70/1E14/58f63923757">
							<positions>
								<Point x="19579" y="7112"/>
								<Point x="19918" y="7112"/>
								<Point x="19918" y="7112"/>
								<Point x="20299" y="7112"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="2" srcEquation="!ed/2e47/1A70/1E14/58f638f94f66" dstEquation="!ed/30a8/4B98/1E78/58f5f657383a">
							<positions>
								<Point x="17399" y="8805"/>
								<Point x="17801" y="8805"/>
								<Point x="17801" y="8488"/>
							</positions>
						</Edge>
						<Edge leftVarIndex="1" rightExprIndex="1" srcEquation="!ed/1a09/654E/1838/58f70be9584d" dstEquation="!ed/30a8/4B98/1E78/58f5f657383a">
							<positions>
								<Point x="15367" y="5821"/>
								<Point x="15663" y="5821"/>
								<Point x="15663" y="7451"/>
								<Point x="16002" y="7451"/>
							</positions>
						</Edge>
					</presentationElements>
				</NetDiagram>
			</diagrams>
		</ed:Operator>
		<kcg:Pragma>
			doc &quot;OperatorKind_1&quot; {OperatorKind = &quot;TBD&quot;}
		</kcg:Pragma>
		<kcg:Pragma>
			doc &quot;Title_1&quot; {Title = &quot;Title : mapfold_compute_distances_1&quot;}
		</kcg:Pragma>
		<kcg:Pragma>
			doc &quot;Author_2&quot; {Author = &quot; Modified by: AP. PORTE&quot;}
		</kcg:Pragma>
		<kcg:Pragma>
			doc &quot;Date_3&quot; {Date = &quot;18/04/2018&quot;}
		</kcg:Pragma>
		<kcg:Pragma>
			doc &quot;CopyRight_4&quot; {CopyRight = &quot; (C) ZSSM. All rights reserved.&quot;}
		</kcg:Pragma>
		<kcg:Pragma>
			doc &quot;Description_5&quot; {Description = &quot; Description:  computes the distance from the input parameters (4 parameters vector) to the vector in the response surface checks if distance is zero (inferior to epsilon)&quot;}
		</kcg:Pragma>
		<kcg:Pragma>
			doc &quot;Change_6&quot; {Change = &quot; PR: First issue - No change.&quot;}
		</kcg:Pragma>
	</pragmas>
</Operator>
