org.jcurl.math
Class CurveCombined<T extends R1RNFunction>

Package class diagram package CurveCombined
java.lang.Object
  extended by org.jcurl.math.R1RNFunctionImpl
      extended by org.jcurl.math.CurveCombined<T>
Type Parameters:
T - type of the parts to be combined.
All Implemented Interfaces:
Serializable, Iterable<Map.Entry<Double,T>>, R1RNFunction

public class CurveCombined<T extends R1RNFunction>
extends R1RNFunctionImpl
implements Iterable<Map.Entry<Double,T>>, Serializable

Combined curve. Becomes more and more similar to List with some restrictions and additions.

Version:
$Id: CurveCombined.java 1031 2009-07-23 15:06:05Z mro $
Author:
M. Rohrmoser
See Also:
Serialized Form

Nested Class Summary
static class CurveCombined.Part<U extends R1RNFunction>
          One segment of the combined curve.
 
Field Summary
(package private)  Map<Integer,String> m
           
 
Constructor Summary
CurveCombined(int dim)
           
 
Method Summary
 void add(double t0, T fkt, boolean dropTail)
           
 double[] at(double t, int c, double[] ret)
          Get the n-th derivative of all dimensions.
 double at(double t, int c, int dim)
          Compute the c'th derivative of the given dimension at t.
(package private) static int binarySearch(double[] a, int min, int max, double key)
          Search only part of an array.
(package private) static
<E> int
binarySearch(List<E> a, int fromIndex, int toIndex, E key, Comparator<? super E> comp)
          Search only part of a list.
(package private) static
<V extends R1RNFunction>
int
binarySearch(List<Map.Entry<Double,V>> a, int fromIndex, int toIndex, double key)
          Search only part of an array.
 void clear()
           
 boolean dropTail(double t)
          Drop all segments with t0 >= t.
 T first()
           
 Iterator<Map.Entry<Double,T>> iterator()
           
 String toString()
           
 
Methods inherited from class org.jcurl.math.R1RNFunctionImpl
at, dim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m

Map<Integer,String> m
Constructor Detail

CurveCombined

public CurveCombined(int dim)
Method Detail

binarySearch

static int binarySearch(double[] a,
                        int min,
                        int max,
                        double key)
Search only part of an array.

Parameters:
a -
min -
max -
key -
Returns:
found index
See Also:
Arrays.binarySearch(double[], double)

binarySearch

static <E> int binarySearch(List<E> a,
                            int fromIndex,
                            int toIndex,
                            E key,
                            Comparator<? super E> comp)
Search only part of a list.

Parameters:
a -
fromIndex -
toIndex -
key -
comp -
Returns:
found index

binarySearch

static <V extends R1RNFunction> int binarySearch(List<Map.Entry<Double,V>> a,
                                                 int fromIndex,
                                                 int toIndex,
                                                 double key)
Search only part of an array. Could be more general operating with Comparable and Objects.

Parameters:
a -
fromIndex -
toIndex -
key -
Returns:
found index

add

public void add(double t0,
                T fkt,
                boolean dropTail)

at

public double[] at(double t,
                   int c,
                   double[] ret)
Get the n-th derivative of all dimensions.

Specified by:
at in interface R1RNFunction
Overrides:
at in class R1RNFunctionImpl
Parameters:
t -
c - derivative
ret - null creates a new instance
Returns:
the value
See Also:
R1RNFunctionImpl.at(double, int, double[])

at

public double at(double t,
                 int c,
                 int dim)
Description copied from interface: R1RNFunction
Compute the c'th derivative of the given dimension at t.

Specified by:
at in interface R1RNFunction
Specified by:
at in class R1RNFunctionImpl
Parameters:
t - t-value
c - derivative (0=location, 1:speed, ...)
dim - dimension (0,1,2,...)
Returns:
the c'th derivative at t

clear

public void clear()

dropTail

public boolean dropTail(double t)
Drop all segments with t0 >= t.

Parameters:
t -
Returns:
false nothing dropped.

first

public T first()

iterator

public Iterator<Map.Entry<Double,T>> iterator()
Specified by:
iterator in interface Iterable<Map.Entry<Double,T extends R1RNFunction>>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2009 jcurl.org. All Rights Reserved.