'flags: \'int\', \'pos\', \'scalar\', \'row\', \'col\''

def _rand_gen(self, *flags):

    val = None
    m = self.m
    n = self.n
    if ('scalar' in flags):
        m = 1
        n = 1
    if ('row' in flags):
        m = 1
    if ('col' in flags):
        n = 1
    if ('int' in flags):
        if ('pos' in flags):
            val = (np.random.randint(5.0, size=(m, n)).astype(float) + 1.0)
        else:
            val = (np.random.randint(5.0, size=(m, n)).astype(float) - 2.0)
    elif ('pos' in flags):
        val = (np.absolute(np.random.randn(m, n)) + 0.1)
    else:
        val = np.random.randn(m, n)
    val[(val > 5.0)] = 5.0
    val[(val < (-5.0))] = (-5.0)
    return val
