Exemple #1
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
Exemple #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
Exemple #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)
Exemple #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)
Exemple #5
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)
Exemple #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)