I guess you can get this information via other function. Otherwise you cannot prepare an array `loc_vec` having correct size.