spline3.html

来自「测试工具jmeter可用来进行性能测试」· HTML 代码 · 共 825 行 · 第 1/3 页

HTML
825
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc -->
<TITLE>
Spline3 (Apache JMeter API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.jmeter.visualizers.Spline3 class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="Spline3 (Apache JMeter API)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Apache JMeter</b></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/jmeter/visualizers/SimpleDataWriter.html" title="class in org.apache.jmeter.visualizers"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/jmeter/visualizers/SplineModel.html" title="class in org.apache.jmeter.visualizers"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Spline3.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.jmeter.visualizers</FONT>
<BR>
Class Spline3</H2>
<PRE>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.jmeter.visualizers.Spline3</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Spline3</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL>

<P>
This class implements the representation of an interpolated Spline curve.
 <P>
 The curve described by such an object interpolates an arbitrary number of
 fixed points called <I>nodes</I>. The distance between two nodes should
 currently be constant. This is about to change in a later version but it can
 last a while as it's not really needed. Nevertheless, if you need the
 feature, just <a href="mailto:norguet@bigfoot.com?subject=Spline3eq">write me
 a note</a> and I'll write it asap.
 <P>
 The interpolated Spline curve can't be described by an polynomial analytic
 equation, the degree of which would be as high as the number of nodes, which
 would cause extreme oscillations of the curve on the edges.
 <P>
 The solution is to split the curve accross a lot of little <I>intervals</I> :
 an interval starts at one node and ends at the next one. Then, the
 interpolation is done on each interval, according to the following conditions :
 <OL>
 <LI>the interpolated curve is degree 3 : it's a cubic curve ;
 <LI>the interpolated curve contains the two points delimiting the interval.
 This condition obviously implies the curve is continuous ;
 <LI>the interpolated curve has a smooth slope : the curvature has to be the
 same on the left and the right sides of each node ;
 <LI>the curvature of the global curve is 0 at both edges.
 </OL>
 Every part of the global curve is represented by a cubic (degree-3)
 polynomial, the coefficients of which have to be computed in order to meet
 the above conditions.
 <P>
 This leads to a n-unknow n-equation system to resolve. One can resolve an
 equation system by several manners ; this class uses the Jacobi iterative
 method, particularly well adapted to this situation, as the diagonal of the
 system matrix is strong compared to the other elements. This implies the
 algorithm always converges ! This is not the case of the Gauss-Seidel
 algorithm, which is quite faster (it uses intermediate results of each
 iteration to speed up the convergence) but it doesn't converge in all the
 cases or it converges to a wrong value. This is not acceptable and that's why
 the Jacobi method is safer. Anyway, the gain of speed is about a factor of 3
 but, for a 100x100 system, it means 10 ms instead of 30 ms, which is a pretty
 good reason not to explore the question any further :)
 <P>
 Here is a little piece of code showing how to use this class :
 
 <PRE> // ... float[] nodes = {3F, 2F, 4F, 1F, 2.5F, 5F, 3F}; Spline3 curve =
 new Spline3(nodes); // ... public void paint(Graphics g) { int[] plot =
 curve.getPlots(); for (int i = 1; i < n; i++) { g.drawLine(i - 1, plot[i -
 1], i, plot[i]); } } // ...
 
 </PRE>
 
 Have fun with it !<BR>
 Any comments, feedback, bug reports or suggestions will be <a
 href="mailto:norguet@bigfoot.com?subject=Spline3">appreciated</a>.
<P>

<P>
<DL>
<DT><B>Version:</B></DT>
  <DD>$Revison$ updated $Date: 2007-01-07 17:09:09 +0000 (Sun, 07 Jan 2007) $</DD>
<DT><B>Author:</B></DT>
  <DD><a href="norguet@bigfoot.com">Jean-Pierre Norguet</a></DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;float[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_A">_A</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;float[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_B">_B</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;float[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_coefficients">_coefficients</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_m">_m</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_maxIterations">_maxIterations</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_minPrecision">_minPrecision</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_n">_n</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;float[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_r">_r</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;float[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#_rS">_rS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#DEFAULT_MAX_ITERATIONS">DEFAULT_MAX_ITERATIONS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#DEFAULT_PRECISION">DEFAULT_PRECISION</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/jmeter/visualizers/Spline3.html#Spline3(float[])">Spline3</A></B>(float[]&nbsp;r)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new Spline curve by calculating the coefficients of each part
 of the curve, i.e. by resolving the equation system implied by the
 interpolation condition on every interval.</TD>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?