예제 #1
0
파일: numpy.py 프로젝트: pymor/pymor
 def random(self, count=1, distribution='uniform', random_state=None, seed=None, reserve=0, **kwargs):
     assert count >= 0
     assert reserve >= 0
     assert random_state is None or seed is None
     random_state = get_random_state(random_state, seed)
     va = self.zeros(count, reserve)
     va._array[:count] = _create_random_values((count, self.dim), distribution, random_state, **kwargs)
     return va
예제 #2
0
파일: numpy.py 프로젝트: JoStWey/pymor
 def random(self, count=1, distribution='uniform', random_state=None, seed=None, reserve=0, **kwargs):
     assert count >= 0
     assert reserve >= 0
     assert random_state is None or seed is None
     random_state = get_random_state(random_state, seed)
     va = self.zeros(count, reserve)
     va._array[:count] = _create_random_values((count, self.dim), distribution, random_state, **kwargs)
     return va
예제 #3
0
 def random_vector(self, distribution, random_state, **kwargs):
     impl = df.Function(self.V).vector()
     values = _create_random_values(impl.local_size(), distribution, random_state, **kwargs)
     impl[:] = values
     return FenicsVector(impl)
예제 #4
0
 def random_vector(self, distribution, random_state, **kwargs):
     values = _create_random_values(self.dim, distribution, random_state,
                                    **kwargs)
     return self.vector_from_numpy(values)
예제 #5
0
파일: list.py 프로젝트: pymor/pymor
 def random_vector(self, distribution, random_state, **kwargs):
     values = _create_random_values(self.dim, distribution, random_state, **kwargs)
     return self.vector_from_numpy(values)
예제 #6
0
파일: fenics.py 프로젝트: pymor/pymor
 def random_vector(self, distribution, random_state, **kwargs):
     impl = df.Function(self.V).vector()
     values = _create_random_values(impl.local_size(), distribution, random_state, **kwargs)
     impl[:] = values
     return FenicsVector(impl)