vector and mat operation