Are you sure your cat is constipated? Rubbing the behind on the carpet is also symptomatic of the pet having worms, and vomiting can also signal urinary tract blockage- the cat can't urinate so the urea backs up into the system poisoning the cat. You need immediate veterinary assistance for this. There may be an impaction in the lower bowel. When it's impacted it's very difficult to correct.The pet appears constipated, and is, but it's so impacted and hard that it's difficult to dislodge. Olive oil might help but if your cat is not having a bowel movement within two hours I would suggest getting him to a vet because a bowel impaction can kill the cat if steps are not taken immediately to correct this. Vomiting indicates that this has reached a serious stage so I wouldn't wait too long on this before seeking help.