Class BrownianMotionCudaWithRandomVariableCuda
- java.lang.Object
-
- net.finmath.montecarlo.cuda.alternative.BrownianMotionCudaWithRandomVariableCuda
-
- All Implemented Interfaces:
Serializable
,BrownianMotion
,IndependentIncrements
public class BrownianMotionCudaWithRandomVariableCuda extends Object implements BrownianMotion, Serializable
Implementation of a time-discrete n-dimensional Brownian motion W = (W1,...,Wn) where Wi is a Brownian motion and Wi, Wj are independent for i not equal j. For a correlated Brownian motion with seeCorrelatedBrownianMotion
. Here the dimension n is called factors since this Brownian motion is used to generate multi-dimensional multi-factor Ito processes and there one might use a different number of factors to generate Ito processes of different dimension. The quadruppel (time discretization, number of factors, number of paths, seed) defines the state of an object of this class, i.e., BrownianMotionLazyInit for which there parameters agree, generate the same random numbers. The class is immutable and thread safe. It uses lazy initialization.- Version:
- 1.6
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BrownianMotionCudaWithRandomVariableCuda(TimeDiscretization timeDiscretization, int numberOfFactors, int numberOfPaths, int seed)
Construct a Brownian motion.BrownianMotionCudaWithRandomVariableCuda(TimeDiscretization timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, RandomVariableFactory randomVariableFactory)
Construct a Brownian motion.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
RandomVariable
getBrownianIncrement(int timeIndex, int factor)
BrownianMotion
getCloneWithModifiedSeed(int seed)
BrownianMotion
getCloneWithModifiedTimeDiscretization(TimeDiscretization newTimeDiscretization)
RandomVariable
getIncrement(int timeIndex, int factor)
int
getNumberOfFactors()
int
getNumberOfPaths()
RandomVariable
getRandomVariableForConstant(double value)
int
getSeed()
TimeDiscretization
getTimeDiscretization()
int
hashCode()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.finmath.montecarlo.BrownianMotion
getBrownianIncrement
-
Methods inherited from interface net.finmath.montecarlo.IndependentIncrements
getIncrement
-
-
-
-
Constructor Detail
-
BrownianMotionCudaWithRandomVariableCuda
public BrownianMotionCudaWithRandomVariableCuda(TimeDiscretization timeDiscretization, int numberOfFactors, int numberOfPaths, int seed, RandomVariableFactory randomVariableFactory)
Construct a Brownian motion. The constructor allows to set the factory to be used for the construction of random variables. This allows to generate Brownian increments represented by different implementations of the RandomVariable (e.g. the RandomVariableFromFloatArray internally using float representations).- Parameters:
timeDiscretization
- The time discretization used for the Brownian increments.numberOfFactors
- Number of factors.numberOfPaths
- Number of paths to simulate.seed
- The seed of the random number generator.randomVariableFactory
- Factory to be used to create random variable.
-
BrownianMotionCudaWithRandomVariableCuda
public BrownianMotionCudaWithRandomVariableCuda(TimeDiscretization timeDiscretization, int numberOfFactors, int numberOfPaths, int seed)
Construct a Brownian motion.- Parameters:
timeDiscretization
- The time discretization used for the Brownian increments.numberOfFactors
- Number of factors.numberOfPaths
- Number of paths to simulate.seed
- The seed of the random number generator.
-
-
Method Detail
-
getCloneWithModifiedSeed
public BrownianMotion getCloneWithModifiedSeed(int seed)
- Specified by:
getCloneWithModifiedSeed
in interfaceBrownianMotion
- Specified by:
getCloneWithModifiedSeed
in interfaceIndependentIncrements
-
getCloneWithModifiedTimeDiscretization
public BrownianMotion getCloneWithModifiedTimeDiscretization(TimeDiscretization newTimeDiscretization)
- Specified by:
getCloneWithModifiedTimeDiscretization
in interfaceBrownianMotion
- Specified by:
getCloneWithModifiedTimeDiscretization
in interfaceIndependentIncrements
-
getBrownianIncrement
public RandomVariable getBrownianIncrement(int timeIndex, int factor)
- Specified by:
getBrownianIncrement
in interfaceBrownianMotion
-
getTimeDiscretization
public TimeDiscretization getTimeDiscretization()
- Specified by:
getTimeDiscretization
in interfaceBrownianMotion
- Specified by:
getTimeDiscretization
in interfaceIndependentIncrements
-
getNumberOfFactors
public int getNumberOfFactors()
- Specified by:
getNumberOfFactors
in interfaceBrownianMotion
- Specified by:
getNumberOfFactors
in interfaceIndependentIncrements
-
getNumberOfPaths
public int getNumberOfPaths()
- Specified by:
getNumberOfPaths
in interfaceBrownianMotion
- Specified by:
getNumberOfPaths
in interfaceIndependentIncrements
-
getRandomVariableForConstant
public RandomVariable getRandomVariableForConstant(double value)
- Specified by:
getRandomVariableForConstant
in interfaceBrownianMotion
- Specified by:
getRandomVariableForConstant
in interfaceIndependentIncrements
-
getSeed
public int getSeed()
- Returns:
- Returns the seed.
-
getIncrement
public RandomVariable getIncrement(int timeIndex, int factor)
- Specified by:
getIncrement
in interfaceIndependentIncrements
-
-