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
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
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)
def random_vector(self, distribution, random_state, **kwargs): values = _create_random_values(self.dim, distribution, random_state, **kwargs) return self.vector_from_numpy(values)
def random_vector(self, distribution, random_state, **kwargs): values = _create_random_values(self.dim, distribution, random_state, **kwargs) return self.vector_from_numpy(values)
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)