Esempio n. 1
0
File: numpy.py Progetto: 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
Esempio n. 2
0
 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 5
0
File: list.py Progetto: 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)
Esempio n. 6
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)