aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSignpostMarv2012-08-29 17:21:01 +0100
committerJustin Clark-Casey (justincc)2012-08-30 00:10:28 +0100
commit6b277394c080f5ad50d07e94f3e21340da4913b3 (patch)
tree0811a30b0b1fb37a037ba727842a2606111838d0
parentRenaming existing 'torture' tests to 'performance' tests instead, since this ... (diff)
downloadopensim-SC-6b277394c080f5ad50d07e94f3e21340da4913b3.zip
opensim-SC-6b277394c080f5ad50d07e94f3e21340da4913b3.tar.gz
opensim-SC-6b277394c080f5ad50d07e94f3e21340da4913b3.tar.bz2
opensim-SC-6b277394c080f5ad50d07e94f3e21340da4913b3.tar.xz
refactoring as the list funcs either skip invalid values or recall ToDoubleList
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs23
1 files changed, 11 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ae92716..45286c0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10119,31 +10119,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10119 public LSL_Float llListStatistics(int operation, LSL_List src) 10119 public LSL_Float llListStatistics(int operation, LSL_List src)
10120 { 10120 {
10121 m_host.AddScriptLPS(1); 10121 m_host.AddScriptLPS(1);
10122 LSL_List nums = LSL_List.ToDoubleList(src);
10123 switch (operation) 10122 switch (operation)
10124 { 10123 {
10125 case ScriptBaseClass.LIST_STAT_RANGE: 10124 case ScriptBaseClass.LIST_STAT_RANGE:
10126 return nums.Range(); 10125 return src.Range();
10127 case ScriptBaseClass.LIST_STAT_MIN: 10126 case ScriptBaseClass.LIST_STAT_MIN:
10128 return nums.Min(); 10127 return src.Min();
10129 case ScriptBaseClass.LIST_STAT_MAX: 10128 case ScriptBaseClass.LIST_STAT_MAX:
10130 return nums.Max(); 10129 return src.Max();
10131 case ScriptBaseClass.LIST_STAT_MEAN: 10130 case ScriptBaseClass.LIST_STAT_MEAN:
10132 return nums.Mean(); 10131 return src.Mean();
10133 case ScriptBaseClass.LIST_STAT_MEDIAN: 10132 case ScriptBaseClass.LIST_STAT_MEDIAN:
10134 return nums.Median(); 10133 return LSL_List.ToDoubleList(src).Median();
10135 case ScriptBaseClass.LIST_STAT_NUM_COUNT: 10134 case ScriptBaseClass.LIST_STAT_NUM_COUNT:
10136 return nums.NumericLength(); 10135 return src.NumericLength();
10137 case ScriptBaseClass.LIST_STAT_STD_DEV: 10136 case ScriptBaseClass.LIST_STAT_STD_DEV:
10138 return nums.StdDev(); 10137 return src.StdDev();
10139 case ScriptBaseClass.LIST_STAT_SUM: 10138 case ScriptBaseClass.LIST_STAT_SUM:
10140 return nums.Sum(); 10139 return src.Sum();
10141 case ScriptBaseClass.LIST_STAT_SUM_SQUARES: 10140 case ScriptBaseClass.LIST_STAT_SUM_SQUARES:
10142 return nums.SumSqrs(); 10141 return src.SumSqrs();
10143 case ScriptBaseClass.LIST_STAT_GEOMETRIC_MEAN: 10142 case ScriptBaseClass.LIST_STAT_GEOMETRIC_MEAN:
10144 return nums.GeometricMean(); 10143 return src.GeometricMean();
10145 case ScriptBaseClass.LIST_STAT_HARMONIC_MEAN: 10144 case ScriptBaseClass.LIST_STAT_HARMONIC_MEAN:
10146 return nums.HarmonicMean(); 10145 return src.HarmonicMean();
10147 default: 10146 default:
10148 return 0.0; 10147 return 0.0;
10149 } 10148 }