I have a dense matrix A  (100x100)   and I want to extract a matrix B from it consisting of the first  N columns of A.   Is there a better way to do it than getting the column using MatGetColumnVector, followed by VecGetArray,  and MatSetValues?  It could also be done using MatGetSubMatrix but is seems to be more involved. <div>
<br></div><div>Thanks, </div><div> </div><div> -Nachiket</div>