solve is now const

release/4.3a0
Frank Dellaert 2009-08-27 01:23:05 +00:00
parent 4911fbd6ff
commit af6d98253f
3 changed files with 19 additions and 13 deletions

View File

@ -335,6 +335,14 @@
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="testConditionalGaussian.run" path="cpp" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments></buildArguments>
<buildTarget>testConditionalGaussian.run</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments></buildArguments>

View File

@ -54,18 +54,16 @@ void ConditionalGaussian::print(const string &s) const
}
/* ************************************************************************* */
Vector ConditionalGaussian::solve(const FGConfig& x)
{
Vector rhs = d_;
for(map<string, Matrix>::const_iterator it = parents_.begin() ; it != parents_.end() ; it++ ) {
const string& j = it->first;
const Matrix& Aj = it->second;
rhs -= Aj*x[j];
}
Vector result = backsubstitution(R_, rhs);
return result;
Vector ConditionalGaussian::solve(const FGConfig& x) const {
Vector rhs = d_;
for (map<string, Matrix>::const_iterator it = parents_.begin(); it
!= parents_.end(); it++) {
const string& j = it->first;
const Matrix& Aj = it->second;
rhs -= Aj * x[j];
}
Vector result = backsubstitution(R_, rhs);
return result;
}
/* ************************************************************************* */

View File

@ -107,7 +107,7 @@ namespace gtsam {
* @param x configuration in which the parents values (y,z,...) are known
* @return solution x = R \ (d - Sy - Tz - ...)
*/
Vector solve(const FGConfig& x);
Vector solve(const FGConfig& x) const;
/**
* adds a parent